The time Earth takes to rotate once relative to the stars: about 23 h 56 min 4 s, nearly 4 minutes shorter than a solar day.
If you time a star's return to the meridian from one night to the next, you get about 23 h 56 min 4 s, not 24 h. This interval, the sidereal day, is Earth's true rotation period relative to the distant stars. (Strictly speaking, the sidereal day refers to the vernal equinox, which drifts slowly because of precession; the difference from the rotation relative to the stars is less than a hundredth of a second.)
The difference from the 24 h solar day comes from Earth's motion along its orbit. In one day, Earth covers about 1/365 of its path around the Sun, nearly 1°: to bring the Sun back to the meridian, it must turn about 1° more than to bring back a star, which takes roughly 4 minutes. Over a year, Earth therefore makes one more rotation relative to the stars than relative to the Sun: about 366.25 sidereal days in 365.25 solar days.
For observers, this sets the rhythm of the starry sky: stars rise about 4 minutes earlier each day. It is also the rate at which the axis of an equatorial mount must turn to follow the stars, sidereal tracking. A mount driven at a 24 h rate instead of the sidereal rate would drift by about 1° per day, roughly 2.5″ per minute of exposure.