According to Newton's First Law: An object at rest tends to stay at rest and an object in motion tends to stay in motion unless acted upon by an unbalanced force.
When a rocket runs out of gas, forces are unbalanced, it slows down, stops at the highest point of its flight, and falls back to earth.