An apple hanging at a branch has potential energy due its position. It can be written as PE= mgh where m is the mass of the apple h is the distance between the apple and the ground and g is the acceleration due to gravity.
as the apple falls from the tree it loses its potential energy and gains kinetic energy due to the movement of the apple. Its kinetic energy will be given by KE= 1/2mv² where m is the mass of the apple and v is the speed with which the apple falls.
As the apple falls the height or the distance reduces and PE becomes reduces. But it gains Kinetic energy due to its speed.
But when the apple falls to the ground and comes to rest its kinetic energy is converted to potential energy.
thus the total energy remains the same. it changes from one form to the other but remains unaltered.