If you were to take a handgun, fire it on the Earth, and then take it into space (which is illegal, by the way), and fire it again, you would have kept everything that produces the speed of the bullet (the mechanism inside the firearm) exactly the same. So if the gun is the same and the bullets are the same, the “muzzle velocity” - the speed at which the bullet leaves the end of the gun, relative to the gun itself - should be identical in space and on the ground. For a pistol, this is somewhere around 1000 feet per second.
What changes is what happens after that. In space, the only force that would act to slow down (or speed up) that bullet after being fired is gravity. On the ground, we also have gravity pulling the bullet rapidly to the ground, but we also have the atmosphere. The air around us seems pretty inconsequential, but if you try to move through it quickly enough, the air itself provides a very substantial resistance; meteors encounter our atmosphere almost like a solid wall.
The air around us resists the motion of anything moving through it, particularly at high speeds. We call this slowing force “drag” or, less inventively, “atmospheric resistance”. Anything moving through the air will encounter this force, so any bullets fired on the Earth will have their forward motions continuously slowed down by drag.
We can actually calculate how long it would take for the forward motion of a bullet to be stopped completely by atmospheric drag. If you take the initial horizontal speed of a bullet to be 300 meters per second (which is the metric equivalent of 1000 feet per second, and the math is much easier in metric), you can work out the rate at which the bullet is slowed down due to drag. The effectiveness of the drag force is related to the density of the object you’re pushing through the air (which is reasonably low for a bullet, since the mass is so slight), the surface area of the object being pushed through the air (which also is small for a bullet), the aerodynamic shape of the object (a flat surface offers more resistance than an oval), and then the velocity of the object.
It turns out that bullets are pretty aerodynamic, which is probably no surprise. Since they’re so aerodynamic, the force of drag doesn’t have that much of an effect, but there is a measurable slowing. After 3 minutes of flying time (which is implausible, given gravity), the distance travelled by the bullet in a second is 8 centimeters less, entirely due to the effect of drag. If bullets were shaped like cubes instead of like bullets, this effect would be much greater.
While the drag force does definitely slow down the bullet, gravity has a much larger effect on the bullet’s flight. If a bullet is fired from a height of 5 feet, precisely horizontally, there’s only a half a second of time before that bullet hits the ground, since gravity is continuously pulling downwards on the bullet. The pull of gravity actually adds speed to the bullet, since it gives the bullet downwards speed, while leaving the forward speed untouched, which means the diagonal speed is higher. This additional contribution by gravity means the bullet can be going faster when it hits the ground than it was when it left the muzzle of the gun.
So: instantaneously after firing, the speed of a bullet in space and on earth should be the same. The effect of drag on the bullet will slow it down on earth, which the bullet would not feel in space, but for objects the size and shape of a bullet, this doesn’t have a very large effect on the speed of the bullet. But, if you’re near a strong gravitational force, either in space or on the ground, you can speed up your bullet well past the muzzle velocity.
(A Note from Astroquizzical Management: Thanks for your patience! I’ve moved twice in the past two months, and have one more move coming up, so things have been hectic! Please keep sending your questions my way, I will get to them ASAP!)