As the distance from the surface of the Earth increases, gravitational potential energy increases. This is given by the formula for gravitational energy:
U = mgh, where U = gravitational potential energy, m = mass of object, g = gravity, and h = height. Since mass and gravity are constant for a specific object, only height changes, and thus, energy is directly proportional to height. If height increases, gravitational energy increases.
But since energy is always conserved (law of conservation of energy), as height increases, kinetic energy is converted into gravitational potential energy. i.e, as height increases, KE decreases, and GPE increases.