Arriving at the ramp to find that the boat batteries are dead ruins your day before it's begun. Adding an onboard battery charger is a fairly simple project, and it ensures that your batteries remain in tip-top shape between trips or while the boat is stored for long periods, such as over the winter.
All battery chargers aren't created equal, and although it might be tempting to use one of the cheap automotive brands, which can often be identified by alligator-type battery clamps and a low price, don't do it. Although they offer a swift boost to the battery, they work by pushing out a large charging current, which diminishes over time as the batteries accept their charge.
One of the reasons these battery chargers are so cheap is that they have unsophisticated internal circuitry. With such chargers, it's possible to overcharge batteries. The consequence is called "boiling dry": the high current makes the electrolyte bubble to such a degree that excessive hydrogen gas is produced, which reduces the electrolyte to unacceptably low levels and ruins the batteries.
A marine battery charger, with more sophisticated internal circuitry than the cheaper automotive types, is designed to be connected permanently to the battery bank; even if it's switched on for several weeks, it won't harm the batteries, dropping the charge if needed to avoid slow cooking of the battery. Many marine battery chargers offer specific charge modes for the different battery types (lead-acid, gel, and AGM). Better chargers often offer temperature sensors, too, because a hot battery is less able to accept a charge than a cooler one.