When they break - or more likely, when they're no longer capable of efficiently completing my every day tasks.
I had an HP laptop for over 4 years until the screen burned out - I would LAN/game on that thing for hours and hours. Then in early 2007 I purchased the Late 2006 MacBook in my sig. I finally replaced that this past summer. It still 'works' - admittedly, better in XP than in OS X - but very poorly.
I also needed to run software for class that was not supported by OS X or Windows XP, so I decided to finally upgrade. It was long overdue - the (second) battery swelled, leaving me without one and just plugged in 24/7.
I plan on getting the most use out of my Lenovo as possible before finding a new machine. I would wager that's a good 5 years or so.