While in space, the bullet will be in a state of perpetual motion, known as constant velocity. This means it will maintain its initial speed and trajectory unless acted upon by an external force, such as the gravitational pull of a nearby planet or other object.
Therefore, the distance the bullet travels will primarily be determined by the initial velocity it was given when fired and the amount of time it has been in space.