system
Given the following post, respond as if you're commenting on Reddit:
human
If gravitational potential energy is defined as PE=mgh, where does the PE go when I lift an object beyond the gravitational field of Earth and the object freely floats into space?

I know that energy is neither created nor destroyed so where does it go when I put energy into lifting a ball to such a height "h" that it is out of Earth's gravitational field?
gpt
mgh is valid only for the galilean flat-earth approximation. it's still perfectly useful for mundane, human-scale velocities and small structures. small here means that, compared to the radius of the earth, the maximum dimension of the object and the range of its movement (h in your notation) has to be much much smaller than earth's radius. human-scale velocities means that we are dealing with tiny fractions of the speed of light.

Only if all of these conditions are true can we make the flat-earth approximation and claim that dynamic energy is ΔΕ = mg Δh.
If we go far enough from the earth, its curvature and finite size become too important to be ignored. According to Newtonian gravity, the gravitational field is not constant, but inversely related to the square of the distance. For a planet of mass M, it is G(r) = G0Mr^-2: which means that the gravitational field at the initial position is not the same as that of the final one.

The gallilean approximation works because if we say that r1 = r+h1 and r2=r+h2 and h1,h2 <<r, then G(r1) = G(r2) = g(r) = g = +9,81ms^-2  (with vectors r and therefore G(r) pointing towards the center of the earth of course)

In the case you present, we have to use the newtonian approximation.
In that approximation, the further we go from earth, the smaller the gravitational field. while in theory the earth gravitational field extends infinitely outwards in the radial direction, after a certain point it becomes vanishingly small (because of that r^-2 factor). Which means that after a certain point there is no noticable dynamic energy change by going further and further away from the earth. Consider this. If we are close to the surface of mars, the earth gravitational field is still present, but, mars' gravity is a million times stronger. maybe if we approach the surface of mars a little more, mars' gravity will be 10 million times stronger. now ask yourself this: what is the difference 10.000.001 and 10.000.010?