People in submarines sleep in berthing compartments in bunks that are mounted in the submarine.
The sleeping bunks in the submarines are in very tight spaces and so there's not much room to spread out to get good sleep.
But eventually the people sleeping in the submarine bunks get used to sleeping in those tight spaces.
Most sailors in submarines stay in the submarines below the water for a period of between 60 to 80 days at a time.
After 60 to 80 days of the sailors being in the submarines the submarine will come to the surface and then the sailors will change shifts and a new crew of sailors will take over and go into the submarine for another 60 to 80 days.
Some sailors may only stay in the submarine for a week or a month at a time while some sailors stay in the submarine longer.
But the actual time sailors stay in the submarine varies depending on the type of submarine and the mission the submarine is on.