Remember the formula used to calculate the gravitational potential energy of a mass given its mass and height above an arbitrary zero level is
PE_{gravity} = mgh
When a pendulum is pulled back from equilibrium through an angle θ, its height is calculated with the formula
h = L  L cos θ
where θ is the angular displacement
The formula used to calculate the kinetic energy of a massive particle is
KE = ½ mv^{2}
In the absence of nonconservative forces, such as friction or applied, external forces, the mechanical energy in a system is conserved. That is 
Another way of looking at conservation of energy is with the following energy diagram. As you can see,
 the "purple" curve represents the pendulum bob's KE which during each cycle begins with an initial value of zero, increases to a maximum value, and then returns to zero
 the "green" curve represents the PE of the bob which begins each cycle at a maximum value, then becomes zero as the bob passes through its equilibrium position, and returns to its maximum value
 the "brown" line represents the total energy of the pendulum bob that always remains constant

Refer to the following information for the next question.
At any intermediate position during the oscillation, the pendulum bob would have both PE and KE.
PE_{max} = PE_{intermediate} + KE_{intermediate} = KE_{max}

See the related lesson on vertical circles if you are asked to calculate the tension of the string during the pendulum's oscillation.
Remember that a pendulum is merely the bottom half of a vertical circle! These conservation of energy methods are the easiest way to determine an object's speed so that tensions can be calculated.