It depends on the quality of the cable. You can theroetically go hundreds or thousands of feet. Optical cables work by reflecting the optical signal along the entire length of the cable. If you were to take an instantaneous snapshot of the signal within the cable, you'd see a zigzagging line from one end to the other. The purer the glass/plastic is, the better it's polished, and the tigher the cable jacket adheres to the glass/plastic's suface, the less the signal is degraded with each bounce.

The main thing you need to watch out for when running an optical cable is to not put any kinks in it. Try to keep the turn radii no tigher than a few inches -- like wrapping it around a 1 liter bottle.