I usually go around 7 to 10 years before building a new machine with usually one GPU upgrade in-between.
I'll keep the computer going until the frame rate on a modern game hits less than 40 on a game I actually want to play which may be longer now since I'm not exactly clamoring to play the next AAA game.