Once a pendulum is moved, simple gravity is what keeps it swinging. Sometimes additional means are used such as weights, pulleys and springs.
A grandfather clock is an iconic example of a machine that uses a pendulum. One back and forth movement of the pendulum is referred to as a period. If a pendulum's period is 4 minutes, that means it takes 2 minutes for it to swing one way and 2 minutes to swing another. As the pendulum swings, the minute hand marks off time on the clock face.
While some older clocks with pendulums work by a person manually starting the pendulum swinging, most have either weights or a spring. In a weighted pendulum clock, the weights hang from the main mechanism on chains. When the pendulum starts swinging, the weights are at the top. As the pendulum swings, the weights lower, which transfers their potential energy to the pendulum to keep it moving. Once the weights reach the bottom, the pendulum stops.
A clock with a spring mechanism works on the same principle. The coiled springs' potential energy powers the pendulum. Once the spring is uncoiled, the pendulum stops. Instead of weights being pulled to start the pendulum, a key is used to wind the clock, which coils the spring.