The Apollo space program was dedicated to human flight in space in general, and specifically to the goal of landing American astronauts on Earth's Moon and returning them safely back to Earth.
The groundwork for the Apollo program was laid with Project Mercury, which conducted activities and the first flights that answered the question of wheter or not it was possible for humans to survive time in space. Project Gemini followed, focusing on developing the equipment and techniques that would be needed for long-distance and time spaceflights. Much information about the impact of periods of weightlessness was also collected through Project Gemini missions.
The Apollo space program acquired its specific mission when President John Kennedy said, during a speech on May 25, 1961,
I believe that this nation should commit itself to achieving the goal, before this decade is out, of landing a man on the Moon and returning him safely to the Earth. No single space project in this period will be more impressive to mankind, or more important in the long-range exploration of space; and none will be so difficult or expensive to accomplish.