I'm referring to, for example Intel's CPU's i5 ..., i7... and the graphics cards like NVidia's GT860, GT970,...
If there's no logic, then always look when the hardware came out and compare it to the others?
Are there good sites to compare CPU's, GPU's & etc.?
There's usually some sort of logic to naming within a particular brand line up. Outside of that, it's just a bunch of numbers. Is an AMD FX-6300 "higher" than an Intel i7-4790? That's a rhetorical question as you can't tell just from the model number in that instance. You'd need to look up a hardware site which compared their performance over various tasks. To look at your specific examples:
Core i3, i5, i7 are a marketing name for some of Intel's CPU's. Core i3 and i5 are classified as "mainstream" while i7 is "performance". Pentium and Celeron are the economy models. Currently, desktop i3's are all dual core with hyperthreading, i5's are quad core, and i7's are 4+ cores with hyperthreading.
The full model number will be something like i5-4690K. The first number (4) indicates the generation (in this case a 4th generation "Haswell" processor, introduced 2013). 690 is just, as far as I know, a number without specific meaning, but it's higher than other models in the series, e.g. i5-4460 or i5-4590, which means it is clocked at a higher rate, and costs more than those two. The K means it's "unlocked" which are aimed at enthusiast consumers and overclockers.
Nvidia's current naming scheme for Geforce GPU's is GT, GTX (or in past series GTS) followed by numbers which indicate generation, and it's place in the model lineup. GTX in the name indicates it's a higher performance card (than GT and GTS cards). The Ti suffix is a further modifier used on some cards, to indicate a higher performance version of the card.
Example: GTX460. The GTX indicates a performance card. The 4 indicates it's from the Geforce 400 series (introduced in 2010 - now discontinued). 60 indicates it's place in the line up, which is upper mid range, or lower high end depending on viewpoint. It's higher than the GTS450 but lower than the GTX470, GTX480.
You can't really directly compare cards across different series, and GPU's advance quite quickly. For example, a GTX480 was a high end $500 card from 2010, so how does it stack up against the mid range (from sub-$200) GTX960 of today? Have a look.