Computers generally have a hardware life span of at least 7-10 years, but a useful life of only 3-4 years. The main reason for this is software & hardware upgrades.
As new software and hardware is introduced, people find they need more powerful computers to take the full benefit out of it.
One way to extend the life of your computer is to upgrade your software and hardware as on needed basis. Another good thing to do is to buy computers that are upgradeable, with plenty of room to add expansion cards, storage capacity, memory etc. Very low-cost desktop computers have almost no expandability.