Mattresses are expensive so I try to keep my mattress as long as possible. But usually at 13 years the mattress is usually ready to be replaced with a new one.
There's no certain amount of years you're required to replace your mattress, you can replace the mattress if it gets too stained or too worn out sooner than the 10 or 13 years if you want.