A 10-year-old water heater does not automatically belong in the trash, but it has entered the part of its life when waiting for failure can turn a routine home project into a soggy emergency. You should consider a replacement when a water heater reaches more than 10 years old, because an aging tank can fail with little warning.
That does not mean every decade-old tank needs immediate replacement. The smarter question involves its condition, performance, repair history, and whether there is enough time to choose a replacement instead of accepting whatever model a hurried plumber can install.