When a pendulum swings back and forth, it is also going up and down. Therefore its potential energy is continually changing. In fact the total energy is a constant because the loss of potential energy goes into kinetic. It is completely at rest at its highest point and has maximum speed at its lowest.
In the graph blue is kinetic energy (KE), orange is potential energy (PE), and green is total energy (TE.)