The trajectory of a bullet depends on two things (in addition to the speed and direction in which it’s initially fired): air resistance and the strength of gravity. The strength of gravity is roughly the same anywhere on the surface of the Earth. However if you go to high altitude the air has a lower density, therefore the air resistance is smaller and the bullet will travel further.
Imagine how far a bullet can go in space then!!!
But if you shot a gun while floating in space, it would push back on you, and you’d shoot off in the other direction… Could be fun, depending on where you end up xD