Ideally car batteries should be replaced at a minimum of 5 years which is about how long they last before you risk being stranded.
I always replace my cars battery and truck battery after 5 years regardless if it still works to prevent being stranded with a dead battery.
If you charge your battery up and it doesn't take a charge then your battery has a dead cell and needs replaced.
Other common signs that you need a new battery in your vehicle are slow engine cranking, battery bloating and swelling or leaking acid out.
If your battery is 5 years old or older then you really should replace it because even if the battery hasn't gone dead yet it will soon.