Shore leave is the leave that professional sailors get to spend on dry land. It is also known as "liberty" within the United States Navy and Marine Corps.
During the Age of Sail, shore leave was often abused by the members of the crew, who took it as a prime opportunity to drink in excess, indulge in other pleasures denied to them aboard the solely masculine ships, and desert. Many captains were forced to take on new members of the crew to replace the ones lost due to shore leave.
Shore leave Wikipedia
Books, films, and songs about sailors on shore leave include Jean Genet's 1953 novel, Querelle of Brest; Gene Kelly and Stanley Donen's 1949 film musical of Leonard Bernstein's On the Town; and Belgian singer-songwriter Jacques Brel's 1964 ballad "Amsterdam".
The US singer-songwriter Tom Waits wrote a song entitled "Shore Leave" in 1982, and included it on his album of the following year Swordfishtrombones. As well as describing the excesses noted above, it also details the loneliness that many sailors feel when they suddenly find themselves with free time but without loved ones to share it with. His separation from his wife (he's in Hong Kong, she's back in the USA) is most poignantly put in a beautifully haunting line: "And I wondered how the same moon over this Chinatown fair/ Could look down on Illinois, and find you there".
In many science fiction stories where space travel is depicted, shore leave has the same basic principle, but is more metaphorical, as a spacecraft crew will not necessarily be disembarking to a planetary location with a shoreline; sometimes said crew will not visit a planet at all, but instead spend their shore leave on a space station with recreational facilities for crewpersons on leave. Filk musician Leslie Fish recorded a song based on the original Star Trek television series called "Banned from Argo", detailing the debauchery and chaos caused by the Starfleet crew on shore leave.
In the 1955 film, Mister Roberts, Mr. Roberts (Henry Fonda) is forced to give up his dreams by working out a deal with the ship's tyrannical Captain Morton (Jim Cagney) in order to give the crew liberty. However, the crew ends up crashing a party for colonel and raiding an admiral's house, which leads to them getting kicked out the very next morning.