Hey,
in vSphere 4 you need to buy 1 license per physical CPU on the mainboard of your ESXi server. The Stanard and Enterprise license allow 6 cores per CPU, Advanced and Enterprise Plus 12 cores per CPU.
in vSphere 5 you still need 1 license per physical CPU, but the core limitation of the physical CPU is gone.
vSphere 4 had a physical RAM per Server limitation of 256GB (unlimited in Enterprise Plus), that is gone in vSphere 5.
vRAM limitation was there for a short time in vSphere 5 but is gone again.
For a quick overview of vSphere 5 licensing take a look here: Compare VMware vSphere Editions
can't find a official table of vSphere 4 anymore, but Remon Lam posted a table on his blog: http://www.virtualclouds.info/?p=1506
Regards