According to ESXi 5.0/5.1 Configuration Maximums, the max vCPUs that can be assigned to a VM is 32. However, I am unable to assign more than 8 on a VM running on ESXi 5.1 U1.
Reason
Most likely the VM was created in ESX 4.1 and migrated to 5.x and hence still uses VM HW version 7. Hence the maximum for 4.1 still applies.
In vSphere 5.0 with Virtual Machine Hardware Version 7, the maximum number of vCPUs per Virtual Machine is 8.
http://kb.vmware.com/kb/1010184
To verify, create a new VM with VM HW version 8, which is the default for ESX 5.x. If you choose custom while creating the VM, you will be able to select the VM HW version. You will now see you can assign upto 32 vCPUs. That is of course on 5.x. The limit has gone upto 128 vCPUs/VM on 6.x