In terms of overall gaming performance, the Intel Core i7-3770 4-Core 3.4GHz is massively better than the Intel Core i5-3470 3.2GHz when it comes to running the latest games. This also means it will be less likely to bottleneck more powerful GPUs, allowing them to achieve more of their gaming performance potential.
The Core i5-3470 3.2GHz was released less than a year after the Core i7-3770 4-Core, and so they are likely to have similar levels of support, and similarly optimized performance when running the latest games.
Both CPUs exhibit very powerful performance, so it probably isn't worth upgrading from one to the other, as both are capable of running even the most demanding games at the highest settings (assuming they are accompanied by equivalently powerful GPUs).
The Core i5-3470 3.2GHz and the Core i7-3770 4-Core both have 4 cores, which is not likely to be a limiting factor for gaming.
The Core i7-3770 4-Core has 4 more threads than the Core i5-3470 3.2GHz. The Core i5-3470 3.2GHz has one thread per physical core, whereas the Core i7-3770 4-Core uses hyperthreading and has 2 logical threads per physical core.
Multiple threads are useful for improving the performance of multi-threaded applications. Additional cores and their accompanying thread will always be beneficial for multi-threaded applications. Hyperthreading will be beneficial for applications optimized for it, but it may slow others down. For games, the number of threads is largely irrelevant, as long as you have at least 2 cores (preferably 4), and hyperthreading can sometimes even hit performance.
More important for gaming than the number of cores and threads is the clock rate. Problematically, unless the two CPUs are from the same family, this can only serve as a general guide and nothing like an exact comparison, because the clock cycles per instruction (CPI) will vary so much.