When it costs more to fix it than a new one costs.
For example, my rev A powerbook G4 12" lost the hard drive after two years. The hard drive was $149. The new system was $1499.
I got a new hard drive.
Mainly because I don't do a whole lot of 'hard' things on it. Email, Web Browsing, some dilly dallying in iPhoto, a few other simple things.
I have a iMac G5 that I use for my photography and playing games. Honestly unless something weird really happens I won't find myself needing a new iMac until the G6 comes out.
As a former PC user, that is weird. I'm used to needing a new one every year.