Generally speaking, a CPU is the brain of your computer. Nowadays, processors are designed to have multiple cores to handle more tasks simultaneously which increases the performance of the CPU in games, as well as applications. Beside the number of cores, some other features such as clock rate, amount of cache, design and architecture of the processor also affect the performance in games.
Number of Cores:
Most modern games are utilized to take advantage of quad-core processors and some games can even use up to 8 CPU threads but they are not fully utilized for hyper-threading technology yet, hence, a number of frames per second in a quad-core processor with higher frequency will be more than let's say a hex-core CPU with lower clock rates and that's all because of the way the games are developed.
CPU Clock Rate (Frequency):
As a rule of thumb, the higher the frequency of the CPU the better the performance will be. You can gain better performance by increasing the frequency of the CPU, but keep in mind that not all processors are suitable for overclocking. To make it simple, an overclocking between 10-15% of the stock frequency is standard threshold for pretty much all processors.
Amount of Cache:
Basically, more cache means more performance. There are three types of cache usually integrated into the modern processors, L1, L2 and L3. When the processor needs to read from or write to a location in main memory, it first checks whether a copy of that data is in the cache. If so, the processor immediately reads from or writes to the cache, which is much faster than reading from or writing to main memory. The CPU first checks the L1 cache which the fastest cache available then checks L2 and L3 in succession. Larger L3 cache is usually shared among all cores and will store more data but at higher latencies.
In the old days CPU manufacturers were emphasizing on the number of transistors integrated into the CPU as the indicator for performance. However, cramping so many transistors in a CPU will create more hot areas on the CPU surface that decreases the performance of the CPU at higher clocks and limits the overbooking ability. This is still a big issue for semiconductor manufacturers and that's were the architecture and technology of the CPU can help to minimize the heat issue. Intel dominates the market for high-end gaming processors (due to more advanced processor technology) but AMD also makes great budget gaming CPUs.
You can simply look at some heat map and power usage benchmarks between the latest AMD FX and Intel i7 processors to find out which one is implemented better architecture in their structure. Although, both AMD and Intel are always seeking to improve the heat efficiency of the CPU by designing new TIM (Thermal Interface Material) and using smaller Lithography (which is reported in nanometer (nm) to gain better performance and lower power consumption but for consumers the best option would be to buy the processor which is more power efficient and provides better performance per dollar. Also, bear in mind that replacing the stock CPU fan with an after market cooling fan will minimize the risk of overheating and increases the stability of CPU under full load.