I5 is a quad core cpu.
I7 is a quad core cpu that has hyperthreading, making it look like a 8 core cpu.
The extra hyperthreads can use unused cycles of the main core to do added work. They perform somewhat like 1/4 of a full core.
GHZ is the clock rate of the cpu, but that does not tell the story. More modern intel cpu chips are more efficient per clock than earlier ones.
And, in general, the intel chips are perhaps 30% more efficient per clock than the amd chips.
For gaming, favor intel with faster cores.
For multithreaded apps, like rendering, the amd FX chips are good if you are on a budget. Above $180 or so, intel will usually be better.