For any overall length, make sure the bullet is seated deep enough to chamber. (I have a couple hundred round of 45 that will function in one of my pistols, but not another...)
Next, round must be short enough to fit and move in magazine. But should be long enough not to allow too much fore and aft movement in the magazine under recoil.
It will vary from bullet to bullet, and as I imply above, from gun to gun at times.