For the Saturn V, the first and second stages both cut off when a low-propellant-level sensor tripped in the tanks. Most launchers' booster stages do something similar -- burning to total depletion would be dangerous for a number of reasons noted here.
For the S-IC first stage, it wasn't unusual to leave 30 tons of propellant unconsumed, as Apollo By The Numbers notes. This is a little more than 1% of the total stage tankage, and represents about 2 seconds of burn time.
For the S-II second stage, the residual propellant was usually 3-4 tons -- less than 1% of the initial amount, and again representing 2-3 seconds of burn time.
The orbital insertion burn on the S-IVB third stage, as with most orbital launchers, was cut off when the desired target velocity was reached. This allowed the stage to correct for off-nominal performance of the first and second stages -- it would do whatever it needed to do to get to the right altitude and speed.
Most of the fuel in the third stage was saved for the translunar burn, which was likewise stopped when the desired change in velocity was accomplished, again typically with 3-4 tons of fuel remaining, though that represents 10-15 seconds of burn time for the smaller, single-engine stage.
I believe all the other major burns on Apollo missions (course correction, lunar orbit insertion, etc) used velocity-based cutoffs as well.