If a ball falls from a height, h. After it falls through a distance, the sum of its kinetic and potential energy
is equal to potential energy at h.
It is equal to potential energy at h. Due to conservation of energy, the total energy at every instant is the same. At maximum height the total energy is equal to potential energy as kinetic energy is zero.