In the equilibrium position energy is in the form of kinetic energy.
In SHM body is acted upon by a restoring force which tends to bring it in equilibrium position.
Due to this force there is potential energy. Also as the body is moving it has kinetic energy.
During oscillation the two energies convert into each other.
Height of bob at maximum angular displacement is h=l−lcosθ=l(1−cosθ)
Also, PE=KE mgh=mgl(1−cosθ)
Note : During oscillation of the body, the two energies convert into each other but their sum (PE+KE) remains constant taking friction negliglble.