According to Gill (now owned by Teledyne...and they make the majority of lead-acid batteries for general aviation aircraft in the USA), the 'average' life of a ships battery is three years.
Beyond three years, the likelyhood of battery failure rapidly increases, especially for aircraft that are not flown all that often.
Having said this, have personally seen Gill batteries last seven years.
Change mine after three years....always.