Suppose an object is at a very great distant from another, much more massive, object. For all practical purposes, it is "at infinity". It has a maximum potential energy, but no kinetic. As it falls, it loses potential energy and gains kinetic. Upon impact, it has no PE, and its KE is maximized. KE = 1/2Mv^2, where v (at impact) is the escape velocity of the object relative to where it is attracted. The PE is the integral of the gravitational force F = G(M)/r^2 from r=0 to r = infinity, where M is the mass of the object, and r is the changing distance.
This holds for an object falling an enormous distance, where the gravitational force is considerably weaker at great distances from the planet (which is why you have to use calculus to integrate the force across the distance r).
For the special local case, say, dropping a cannonball off a tall building, the gravitational acceleration g at the top of the building is almost identical to that at ground level (roughly 10 m/s^2), there is no need to integrate. You can just use Mgh, where h is just the height of the building in meters. So when you drop a mass M Kg off the top of a building, its initial KE is zero, and its PE = Mgh. When it hits the ground, the KE = 1/2Mv^2 and the PE is 0.
The total PE of any object "at infinity" will be equal its KE when it finally hits the ground. The KE at that instant will be equal to the Object's KE at escape velocity. In other words, the energy required to leave a gravity well is equal to the energy released when you fall into it.
For a more rigorous discussion, see
https://en.wikipedia.org/wiki/Escape_velocity
Space/Science » in reply to Orbital energy is divided into two parts.
More gravitational kinematics...
