You start on a beach. You go to the moon. You come back. Y ou go to Hollywood. You then go to the summit of Mount Everest. Have you incr eased your gravitational potential energy more than if you had climbed to this summit without all the other side trips?
No, you have not.
Gravitational energy is a function of your position only. If you denote your original position, on the beach, by `r_1` `` , and the final position, on the summit of Everest, by `r_2` , the change of your potential energy, U, will be
`Delta U = U(r_2) - U(r1)`
It does not matter how you have reached your final position.
This highlights the fact that gravitational force is conservative, which means the work done by gravity is path-independent: it depends only on the final and the original position, but not the path in between.