Using the equation, you want \(-\frac{GmM}{r} = 0\text{.}\) This only looks to be true in the limit where \(r \rightarrow \infty\text{.}\) So the gravitational potential energy is equal to zero when the two masses are infinitely far away from each other! As with any other potential energy, you could change the location where \(U = 0\) by adding a constant to \(U\) without changing the physical system (this is known as changing your reference point).
2.Approximation: Near the Surface of the Earth.
When you are near the surface of the Earth, you can model the gravitational force as \(\vec{F}^g = mg (-\hat{y})\text{.}\) Use this to find the change in gravitational potential energy when an object goes from \(y_i = 0\) to \(y_f = h\text{.}\)
Definition4.10.2.Gravitational Potential Energy near the Surface of the Earth.
For a system with a small massive object (mass \(m\)) close to the surface of the Earth, the gravitational potential energy is \(U_{grav} = mgy\text{,}\) where \(y\) is the vertical distance from the location where \(U_{grav} = 0\text{.}\)