It sounds like a pretty hypothetical problem right now, but just you wait. When future workers are marooned on the Moon or Mars for months or even years at a time, mental breakdowns will be common.
At least, this is the opinion of Rutgers School of Business, Camden professor Chester Spell. He's extrapolated the current mental health of workers in remote locations, like Australian mining towns and Antarctic research stations, to the conditions that astronauts will experience during long duration space travel. Despite the high adventure that goes along with their careers, these workers experience higher rates of depression, and the physical woes that can go along with it.
On the Moon, the cramped conditions, extreme isolation, and lower gravity will take its toll on astronauts. And if one team member is feeling down or anxious, the mood can spread to others on the team like a "social contagion", eventually bringing everyone down.
What's the solution? Managers and mission planners have to put an emphasis on social interaction among the team members, and not allow anyone to "go dark". Since help could be hundreds of thousands or even millions of kilometers away, everyone on the team will need to recognize the signs and be able to support one another.