Many can go on producing for years, but with smaller litters. Health problems like arthritis can become an issue, as they can't stand for the boar. Older sows can be prone to prolapses - but then, I had a two year old that had one.
I've got a 6 year old in pig at the moment (she won Tamworth Champion of Champions at the weekend) and, fingers crossed, she is in good health and I'll let her carry on as long as she seems fit and healthy. I'd like to think she'll live out her days here and then we'll get the digger out and excavate a huge grave in the orchard.