Conventional "wisdom" says you shouldn't sleep on a mattress for more than 10 years.
But, there are many variables that go into why this number was created.
1. Your weight
2. Number of people in the bed (ie 1 vs 2)
3. If the mattress actually works for you or not. If you are WAKING WITH PAIN, looks at replacing your mattress.
But the biggest one is 4. The mattress quality.
There is a HUGE difference in mattress quality out there.