Twelve people walked on the Moon during the Apollo program.
They were the lunar surface crew members of Apollo 11, 12, 14, 15, 16, and 17. Each of those six missions placed two astronauts on the surface, producing a total of twelve lunar walkers. The first were Neil Armstrong and Buzz Aldrin in July 1969, and the last were Eugene Cernan and Harrison Schmitt in December 1972.
The number is smaller than the total number of Apollo astronauts who traveled to lunar orbit. Command module pilots such as Michael Collins, Richard Gordon, Stuart Roosa, and Alfred Worden orbited the Moon but did not walk on it. Apollo 8 and Apollo 10 also carried crews around the Moon without landing.
No human has walked on the Moon since Apollo 17. The twelve walkers remain the only people to have traveled to and explored another world’s surface.