The Roche Limit is the nearest to an astronomical body that a body orbiting it can approach before breaking up. A Moon within its planet's Roche Limit is being pulled apart by the planet's Gravity more than its own gravity is holding it together. Thus at this limit, moons (or in the case of stars, its planets) tend to break up into rings (like Saturn's) or Circumstellar Disks. The exact formula depends upon a few factors, but a basic formula is:
d = Rm(2 MM/Mm)1/3
This formula is derived by determining the distance at which the gravitational force and Tidal Force balance. At longer distances, the secondary body's gravity dominates, holding it together, and at shorter distances, the tidal force from the larger body overcomes its gravity and pulls it apart.