It is far better for battery life to leave your laptop plugged in than to do deep discharges. It is specifically deep discharges that reduce battery life. It seems that this point is often misunderstood. Let me overview the causes of lithium ion batteries to lose their battery life (capacity), and some steps that can be taken to avoid it.
1. Lithium ion battery lifetimes will reduce as you use it.
The deeper you charge/discharge your battery, the more it will reduce.
If you made 200 full deep discharges (from 100% to 0%), you will find that your battery now has less battery life than doing 2000 light discharges (100% to 90% for example). For this reason it is far better to leave your laptop plugged in than to do deep discharges, you’ll soon find your battery totally worn out if you regularly drain the battery all the way.
However, that’s not the only issue at play:
Probably the biggest killer of battery life is high temperature.
High temperatures, it doesn’t help that laptop batteries are often in the vicinity of the hot underside of the laptop. This kills off batteries like nothing else. So ideally you want to keep the battery cool. This means if you have a laptop that runs very hot, and you are concerned about battery life, the two things you can do are: invest in a laptop cooler (though you should also consider the cost of a laptop cooler vs just buying a new battery later on), and disconnecting the battery once it’s charged (balanced against the risk of accidentally unplugging the power while the battery is not in).
Finally, a lesser issue:
3. Lithium ion batteries have a limited shelf-life anyway.
If you left a lithium-ion battery on the shelf unused, it will deteriorate in battery life anyway.
The amount of charge that the battery holds while it is being stored affects its lifetime, a battery stored at 100% charge ends up with shorter battery life than one stored at 40-50% (the ideal storage charge). So if you are going to leave a laptop for a long time and are worried about battery life, run it down to 40% (and optionally put it in a water-tight bag, in a fridge, not a freezer, a fridge). Technically this does mean actually that it would be better for laptop battery life to keep the battery charge at around 40-50% all the time, but that kind of defeats the purpose of having a laptop battery.
HOWEVER, there may be one situation where you might want to do a full discharge – all laptops have a small circuit that keeps track of the charge level on the battery, called the battery fuel gauge. Measuring the capacity of a battery is not an exact science, so this circuit needs calibration. This is why manufacturers recommend that you should do a full charge and then discharge when you get a new battery or device – it’s not because this does anything good for battery life, but rather because it gives an opportunity for the battery fuel gauge circuit to calibrate itself to display the correct battery capacity. Nothing happens if you don’t do this, other than an incorrect battery life reading.
After you’ve used a battery for a long time, particularly if you keep it plugged in all the time, the battery fuel gauge might get a bit “out of sync” with the battery (accumulated measurement errors, change in battery life, etc.) and no longer show a correct battery life reading. Doing a full charge/discharge cycle recalibrates the fuel gauge, allowing it to display a more accurate battery life reading. But this is a purely cosmetic thing – it doesn’t do anything for the actual battery life.
Be careful about a lot of the myths about battery care, a lot of them stem from advice given for NiMH/NiCad batteries (which are very rare in laptops these days), many of which either do not apply, or are completely opposite to the recommendations for Lithium ion batteries.
Personally however, I just resign to the fact that laptops are great because they’re convenient, but have a limited battery life regardless of what you do. So I just do whatever’s convenient – plug it in when it needs charging (or when I remember to), and unplug it when I need to move it. If the battery life deteriorates to a point where it no longer suits my needs, I’ll buy a new batter. Or if it’s time to upgrade, buy a new laptop.
Edit: it’s been a year since I wrote this answer, and I’ve discovered that my new laptop, a Lenovo Yoga 2 Pro, comes with one useful utility that manages the battery. It has one option that you can turn on, called “conservation mode” which only charges your battery up to 60%.