Well, that depends. It depends on use and damage. For some, a rope will last several years...whereas for others, not so much.
A few years ago I opened up a new rope and took it on an ascent of Cutthroat Peak in the Cascades of Washington State. On the descent, the rope was damaged right in the middle. So literally, on the very first day of use, I had to cut a rope in half.
Assuming that there is no obvious damage, the length of time that you use a rope should be directly connected to the frequency of use. Check out this chart:
A second consideration is how you're using a rope. The longer you use it, the less it will retain its dynamic elasticity. And if you do something weird with a rope (i.e. use it to pull a vehicle - not recommended), that elasticity can disappear even faster.
Part of your process before climbing should be to do a check of the rope. You should ensure that the rope is in good shape before putting your life on it. The following video covers all the basics of checking your rope before use:
Many climbers use a rope beyond it's capacity for safety. It's important to retire your ropes when they need it. Your life is worth more than a rope...
--Jason D. Martin