Actually keeping a microwave for a length of time has to real time limit on it. Rule of thumb is if it is working and heats well and the seal around it is not damaged in anyway there is no need to replace it. I would just inspect it to make sure the seal is not damaged in anyway every so often.
I agree with that answer too. They are so cheap to buy now compared to a number of years ago, that if your is not working properly or broken in any way, a new one would use less electricity and not cost much to buy.