You should only need to replace your washing machine when it's not cleaning the clothes properly or is leaking or doesn't work anymore.
Usually after 10 years I will get a complete new washer and dryer set because by that time the current washing machine and dryer is likely to fail anyway.
I'd rather replace the washer and dryer before it actually fails and when I have the money to do so.
You should easily get at least 10 years out of a new washing machine though before needing to replace it.