Ideally, you shouldn't toss them into the garbage. In fact, in some places it's illegal to throw batteries in the trash! So whether it's your standard alkaline AA battery, a rechargeable cell-phone battery, or the battery from your car, you should treat it with care by using safe storage and disposal methods.
Why? Most batteries contain toxic ingredients like cadmium, lead, lithium, or sulfuric acid. Batteries can leak and get into the ecosystem and groundwater. You should be concerned about that.
And while old batteries may not generate enough energy to power a device, they could still spark a fire if they're not handled carefully.
Store them in a secure container that keeps them lined up side by side so that the contact points can't touch each other or brush against anything that's metallic or conductive. You can also put a little piece of tape on the positive and negative ends to prevent a short circuit or any other type of current coming from the batteries.
An even better option is to dispose of old batteries in the container they came in.
Many businesses have battery recycling programs, and stores like Best Buy, Lowe's, and Staples will take certain kinds of batteries as well. Also, many towns host events to collect batteries along with other hazardous waste and electronics, and some may have permanent drop-off locations.