Depends on the type of joint.... Floppy ball joints can be restored with a bit of superglue on the ball end (I believe there's a post here somewhere detailing the technique).
Friction joints can be maintained by keeping dirt and grit out, and occasionally tightening any screws a little if needed. A plastic washer may help keep them tight and avoid wear.
Ratchet joints will either last forever or wear to nothing, depending on how much you play with the toy and how well-made they are. Again, keeping them clean will do wonders.
If your ratchets go, it may be a case of replacing the spring, or finding a new ratchet piece. The latter will be very difficult, of course.
Bottom line, keep them clean, avoid overtightening screws, and pray to the joint gods daily.