Dear Student ,
A simple pendulum consists of a bob that is suspended by a section of string with a support. It works on the principle of alternative transformation of kinetic and potential energies. At any instant, the total energy of the bob remains the same.
The pendulum comes to rest due to the resistive force of air or the friction of air acting on the pendulum .
When the pendulum stops then the whole energy is converted in to the potential energy .
Regards