Maximum Range for 9mm Pistols
A 9mm round can travel about 2400 yards when fired at the optimal angle to maximize distance. According to the US Army the effective range of the 9mm pistol in combat is 50 yards. Professional competitive shooters can go out further on targets and sometimes approach 100 yards. At this distance the bullet drops over half a foot so the shooter’s aim must be carefully adjusted for gravity and wind.
Eliminating any variation of the shooter, a typical 9mm handgun that is mounted in a fixed vise can shoot groups with a scatter of <4" diameter at 25 yards. Some highly-tuned hand-fitted 9mm pistols achieve <2" groups at 25 yards.
Shorter barrel 9mm pistols for concealed carry are more challenging for accuracy compared to full size pistols. Count on being able to reliably hit a target the size of a person at 30 yards with consistent practice. But factor in an adrenaline dump and you may drop your effective range to less than 10 yards.
Practice will dictate your effective range. To pass a concealed carry qualification test for states that require proficiency testing, you usually need to place ~70% of a few dozen shots at human-sized targets at a range of ~10 yards.
9mm rounds can penetrate most interior walls and doors as well as auto windshields. Trajectory will veer from the original flight path, but the bullet may retain enough energy that it can be lethal. Many exterior walls will stop 9mm rounds, especially brick and cinderblock.
A 9mm round shot into water will slow quickly and it will not be lethal beyond a distance of about 3 yards (Mythbusters Episode 34).
Be aware that semiautomatic pistols may fail to fire if you press the muzzle on the object you intend to shoot, such as could happen when entangled in close combat. Pressing the muzzle can cause the slide to move backward. And if it moves back more than about a millimeter then the gun will go out of battery in which case pressing the trigger will not fire the pistol.
In self defense the majority of gunfights involving civilians and felons takes place at distances less than 5 yards. On average 3 shots are fired and shooting ends within three seconds. Standard deviation is so large that you should consider training for multiple distance scenarios.