It is time to replace a water heater when it begins to corrode and leak, regardless of its age. Once a water heater reaches 10 years, replacement should be considered as soon as anything starts to go wrong.
A water heater is not working properly if the water is cold or not warm enough, the unit is making odd sounds, the unit is working erratically or the water tank is leaking because of corrosion. Some of the problems can be serviced, however, older water heaters become less efficient over time and the cost of repair can out way the cost of a new unit. For corrosion damage, a replacement is necessary because that cannot be repaired.