There are 2 main things determining number of cells for our BLDC motors:
1/ maximal allowed RPM which is usually somewhere at 15000 on our full stunter motors (smaller will be higher). This does not limit us as Will already wrote, because we use governor and it will not allow high RPM even without prop. But be carefull if you calibrate ESC, some ESCs try to run motor without prop to its max RPM.
2/ However point 1/ is not valid on LOADED motor and that is real limitation, if you do the math, then you will see that on FULL THROTTLE and loaded motor under its max RPM limit you are going to exceed not only current of good efficiency, but also highest allowed current. Simply too high voltage will not allow RPM in safe range and also save current at the same time.
So those 2 things determine rated cell count. Howeverer we need some head room for voltage, especially with active timers and our ESC is never open for full 100%, so usualy we use max num of cells +1. If you go higher, you will face troubles mentioned by Tim, especially ESC overheating.