How can one calculate the amount of energy needed to displace pendulum with given mass m and string length L to $\alpha$ degrees from resting position when acceleration due to gravity is known?
By considering the variation in the potential energy $V=mg\Delta y$ due to the vertical displacement $\Delta y$.
A displacement of an angle $\alpha$ would move the mass of the pendulum horizontally by $\Delta x=L \sin\alpha$ and vertically by $\Delta y=L(1- \cos\alpha)$.
Therefore the energy required for a displacement of an angle $\alpha$ amounts to $mgL( 1-\cos\alpha)$.
If the pendulum is a bar or more generally an object of any shape, of course, you replace L by the distance from the pivot to the centre of mass.