We all use a lot of batteries these days, and these tend less often to be the disposable kind. Rechargeable batteries, from our phones and laptops and tablets and whatever other gadgets we use are pretty much constantly in a discharge-recharge cycle - many on a daily or almost-daily basis. There are a few things you can do to make sure your batteries stay happy, and ensure that you get the most power from them for as long as possible.
Batteries do degrade over time, a ballpark figure would be that you'll lose about 20% of it's per-charge lifespan after about 1000 charges; your mileage may vary. Part of this is through alterations in the battery's chemical make-up over time, but part of this is also due to the microchip that monitors and controls the battery.
The chip controls the rate of charging and is also responsible for communicating the remaining charge to your device. This is an imperfect process, and therefore there is a predictable margin for error. The more charge cycles, the bigger that error will potentially get. There's a couple of pretty simple things you can do to maximise the working lifetime of your battery and ensure best performance for as long as possible.
Use Your Battery
Number one is to use the battery. They tend not to like being constantly fully charged or fully discharged for a long period of time; so it's also important that if you intend to store your device for a prolonged period you do so on 50-70% charge. The battery will naturally discharge over time, of course, so you should make a point of firing up your gadget and charging it every once in a while.
Discharge Your Battery
There's a flat battery, and then there's a flat battery. Most gadgets, when the battery gets sufficiently low, will appear to turn off (often responding with a charge symbol if you try to activate them). At this stage the battery is not fully discharged - the device has gone to sleep to preserve it's memory state, so that you don't lose any of your stuff, and the gadget is ready to roll again as soon as you plug it in. This is pretty convenient for the most part.
It's possible however that over extended periods of use (months), that it's determination of when to switch off and conserve power will get further and further off the mark. To recalibrate this, you need to run the battery down beyond it's deactivation point. In most laptops, about five or seven hours after it powers down will be enough to ensure the battery has totally discharged. Make sure your files are saved before you do this, though many modern operating systems will save their status to your disk before this becomes a worry. Once you've waited those few hours, charge back up to full power and go about your business.
The same thing applies to your phone or tablet (or e-reader etc.); however in these cases the time between powering down and truly discharging can actually be a lot longer due to their comparative energy efficiency. Leave them overnight, or for a day if you can - then charge them up and carry on. Again, make sure your data is secure first.
Batteries can run in to trouble if they get too hot or too cold. They are pretty resilient though - and it's a fairly safe bet that if you're comfortable with the temperature then your batteries are fine - just be aware that phones and the like tend to get very hot if you're using them in direct sunlight, and uses such as turn by turn navigation in a dashboard cradle can cause overheating, especially while also connected to your in-car charger.
If you're really having battery life trouble, there's only so much you can do by tweaking settings. There's a number of great guides on the net; if they're not helping, there's a good chance you have a bona fide fault, look into replacement.