My take- replace what can cause massive damage if it fails, if it's showing signs of impending doom. This includes dishwashers, garbage disposals, and water heater tanks. Don't replace something that can be replaced time of with little doom, like things involved in climate control or normal cooking (stoves, AC/heat, so on).
...basically, if it'll flood, I replace it if it earlier (ex, the 26 year old hot water heater the house came with couldn't be drained. Clearly it hadn't been being taking care of. So there was no way to know how bad it was... except that the house had been empty for the prior 8 months, and the owner did no maintenance the prior 6 years minimum. This, plus clear efficiency gains, AND an undersized tank for the house, made it an easy choice to replace). Our heat pump on the other hand? It was our big worry moving in, and it's still working just fine a couple winters in.