Although the second gen i7 has a slower clock speed it is actually faster.
It is going to have a larger CPU instruction cache, as well as a newer memory controller which is going to allow it to assign memory faster and more efficiently.
Also, the i5 is a dual core, with a total of 4 logical threads.
the i7 is a quad core with a total of 8 logical threads. This will help a lot on newer multi-threaded games and applications.
Nowadays you are not limited by the CPU speed as much as you are by it's ability to handle more data at the same time, which is why the more powerful, higher thread count CPU is going to out perform the faster processor.
I don't know how powerful the GTS540M actually is, but being a low-mid range laptop card it's probably safe to say both of those processors will game about identically because your fps limit will be on your GPU not your CPU.
However it is correct that the I7 is more powerful for reasons mentioned above already.
Okay. The screen is 1366 x 768 so the fewer pixels on screen means I can use medium/high settings?
You should be able to play most games with medium quality settings and anti aliasing set to x2.
My Lenovo IdeaPad Y470 has a Core i5-2410M and a GT 550M. While testing Crysis I was able to get between 35FPS and 44FPS in the second chapter "Relic" most of the time. It probably dipped as low 25FPS and peaked at around 54FPS.
The GT 540M will probably get around 29FPS - 38FPS most of the time in Crysis. I tested less demanding games like Fallout 3 and Mass Effects on my GT 550M so they should run pretty well on the GT 540M too.
I might borrow GTA IV from my cousin and give that a spin on my laptop.