A Stasis Leak was a temporal anomaly that allowed travel in time.
When Lister found a photograph of himself marrying Kochanski in the past, he realised that there must be a way to travel back in time. He remembered Rimmer had once seen his own head telling him that he had come from the future, that Rimmer had dismissed as a Titan Mushrooms halluciantion, so Lister read Rimmer's diary about the incident. The head had stated that there was a Stasis Leak on Floor 16, but Holly could not explain what that was. Lister, Rimmer, The Cat and Holly travelled down 2,567 floors in an Xpress Lift to Floor 16 to see what might be there.
They found a glowing hole in the wall next to the unused stasis pod (not the one Lister was in for three million years) through which they could step. On the other side, they found themselves in a shower room on Red Dwarf, approximately 3 weeks before the radiation leak killed the crew. The Cat demanded an explanation of what the Stasis Leak was. Rimmer suggested that it was a rent in the spacetime continuum or a singularity where normal laws did not apply. Lister speculated that when a stasis field escaped the booth that it would preserve whatever it had leaked into, like the shower room. The Cat did not understand any of these explanations, until Lister said it was simply "a hole into the past", which The Cat took to mean "a magic door". Embarrassingly, there was a man in the shower.
They soon determined that they could travel back and forth at will, but anything they tried to bring back to the future (besides themselves and whatever they had on them when they went back in time) would be turned to powder. Lister realised that they would be able to save one person by convincing them to use the spare stasis booth. He tried to ensure that Kochanski survived, but discovered that a version of himself had travelled back from even further into the future to marry her. Rimmer tried to convince his past self to go into stasis, but he was unsuccessful because the past Rimmer thought he was hallucinating from ingesting Titan Mushrooms.