Context is everything!
In very simple terms there are 3 key things that matter:
- CPU architecture
- Clock Speed
- Cores
(it is, of course, much more complicated than that, but is basic terms that's what matters).
Having more cores is obviously better, but only when a program can actually make use of the extra cores. Things like encoding a video tend to be very good at using additional cores and often scale almost perfectly (so the 2 extra cores allows the encode to finish half as fast again). Games, on the other hand, are rarely able to benefit from more cores and often will see little benefit from any more than 2 cores.
Obviously clock speed matters (3.5Ghz, 4Ghz, etc). There are lots of gaming benchmarks (and in fact plenty of other benchmarks not able to use the additional cores) where a quad core 4790K at 4.4Ghz does better than the 8 core 5960K @ 3.5Ghz.
Architecture matters too. The "6 core" AMD FX-6100, for example, will lose in some benchmarks to an Intel i3 (dual core) despite having more cores AND higher clock speeds. The architecture of the Intel CPU in those cases is managing more instructions per clock.
If you had a specific question about a specific build, post it back and we might be able to provide some better advice.