The most important variable in stopping power is shot placement. For the most part, shot placement is more important than muzzle velocity, ballistic coefficient, and bullet diameter.
Shot placement can only be improved via training. The more training you have with your weapon, the more accurate your shot placement will be, and the better the stopping power will be.
For most people, the amount of time training with their weapon is inversely proportional to the price of the ammunition. The more expensive their ammo is, the less they tend to train with it, and hence the less effective they will be with it. This simple concept is lost in may discussions on caliber and stopping power.
A 45 ACP, for example, might have an edge on inherent "stopping power" by virtue of its large diameter, but this edge is usually negated by insufficient training time due to the high cost of ammo. On the other end of the spectrum is the 22LR... it's cheap enough that a person can practice with it a lot, but it falls way short in the "inherent stopping power" category.
So... very small caliber is bad (e.g. 22LR) because it can't incapacitate a bad guy in a short period of time. Large caliber (e.g. 45 ACP) is usually bad because you probably won't practice with it enough due to the high cost of ammo. For most people, then, a medium caliber is best. The 9 mm is such a caliber. It is cheap enough that I can practice with it on a regular basis, and powerful enough that it can incapacitate a bad guy in a relatively short period of time (assuming good shot placement, which is achieved via training).
Now, having said ALL of that, it should be mentioned that bullet diameter is not the most important "inherent" variable when it comes to handgun rounds (when comparing commonly-available rounds). Depth of penetration is the most important variable. Bullet diameter is a close second.