Dear Student,
As we know the mechanical energy (sum of its potential and kinetic energy ) remains same.When the ball in on the ground its velocity is zero. and its height above the ground is also zero. Thus the mechanical energy of the whole system is zero.
Now as the ball is thrown upwards its initial velocity is high and its height above the ground is less. As the ball continues to move upward its upward velocity reduces and at the same time its height above the ground increases. At the top most part of its trajectory its velocity is zero and its height is maximum. After this point the ball begins a free fall and its velocity increases and its height reduces.
In terms of energy at the beginning the ball has high kinetic energy and no potential energy. As it moves up its kinetic energy gets converted to potential energy. At the peak its kinetic energy is nil and it has the highest potential energy. From now onwards its potential energy begins to be converted to kinetic energy as it falls to the ground.
In other words the sum of kinetic energy and the potential energy remain same.
Regards