A car battery should last around 6 years but like most car parts, that all depends on how you treat it. Multiple discharge/recharge cycles shorten any battery's life and using electronics in the car while the engine not running is the quickest route to a dead battery. Of course, a battery can maintain a charge while the engine is on, but once it's off electronics draw directly from the battery.
Failing batteries usually display obvious symptoms that let you know it's on its way out. Slow cranking on startup indicates that the battery may not be able to provide enough power to fire up the engine, and an illuminated Battery warning light on the dashboard is clear indicator it needs attention. If vehicle electronics like remote locks or interior lights randomly stop working, a dying or dead battery could be why.