Here's a breakdown:
* Total time spent on the lunar surface: This is the time astronauts spent walking on the moon, conducting experiments, collecting samples, etc. The total time spent on the lunar surface by all Apollo missions was approximately 75 hours. The longest single mission was Apollo 17, where astronauts spent 22 hours and 4 minutes on the moon.
* Total time in lunar orbit: This includes time spent orbiting the moon, taking photographs, and conducting scientific observations. The total time spent in lunar orbit across all Apollo missions was considerably longer, exceeding 1,000 hours.
So, to answer your question, the astronauts spent 75 hours on the lunar surface, with the longest single mission lasting 22 hours and 4 minutes.