The kinetic energy is the energy at a given point in time
E = 0.5*m*v*v
So it takes into account the mass of the moving body and the velocity at which it is moving.
In relation to a varying g, g is a vector and gives the acceleration due to gravity at a given point from the centre of a mass.
I think what you might be getting at is a problem whereby, for example:
A mass of 2000kg is moving at 10ms-2 away from the surface of the earth. How high will it get.
The equation V= - GM/r should be used here where V is the potential energy at a given point. It's a negative value as it is defined as the energy required toraise a mass from infinity to that distance (r) from the centre of a mass (M)
To answer it, the mass which is moving from the earth's surface has E=0.5*m*v*v which is equal to 100000J
It therefore has 100000J to "spare" (neglect air resistance and all that malarkey)
V=-GM/r
V = the energy at the earth's surface
G = gravitational constant
M = mass of the central object, in this case the earth's mass = 6x10^24kg
r = distance from the centre of the object (at earth's surface, = earth's radius = 6.4x10^6m)
So at the surface, energy = GM/r = 62531250J
And the energy being lost in this direction is the kinetic energy, = 100000J
So final energy = 62531250J - 100000J = 62431250J
From the same equation, the final distance away from the centre is found to be:
V = -GM/r
62431250 = -(G x 6x10^24) / r
So, r = (G x M)/62431250
r = 6410251m
This distance is from the centre of the earth, so distancemoved = this distance minus the "centre to surface" distance, equal to
d = 6410251 - 6400000
d = 10251m