It can be anywhere from under a year to many years depending on use, etc.

Signs it needs replacing:

If it's tacky or sticky feeling to the touch

If it's shrunken or stretched so it doesn't fit properly

If it consistently takes longer to reach pressure than it should

if it's hard or cracked. (You can test for hardness by poking it with a fingernail. There should be no permanent indentation. If there is, time for a new one.)

If steam is leaking around the lid and reseating it doesn't solve the problem, try releasing the pressure and looking at the spot where the leak was occurring. See if there's a crack there. (If reseating does solve the problem, make sure there aren't food bits stuck to the gasket)

You should ALWAYS replace the gasket with one from the original manufacturer. Substituting on this can be a real mess. Here's a link to a Magefesa site I found. If they're selling the pc's, they should be able to get parts, including the gasket, for you: