As preventative maintenance you should replace your battery at least every 4 years.
Any longer than 4 years then you risk being stranded due to a faulty car battery and might need to get the battery jumped.
I've always stuck to replacing my cars battery every 4 years and I've never had a battery die on me in my car.