Laptop Lithium Ion batteries are very expensive (quite a few of them are over (WAY over, in a few cases) $200). They CAN last 10 years (in fact I have some 1995 Toshiba batteries that are still nearly as good as new), but they can also be destroyed in less than 6 months. As an engineer who has both worked for laptop manufacturers and who services laptops, here is what I can tell you:
The most important rule of getting good life from a battery is this: If you are not traveling, if you are stationary and are going to be plugged into a wall outlet for a day or two or perhaps essentially all of the time, take the battery out of the computer entirely and store it in a cool, dry place (some people will recommend a refrigerator, but that is not necessary, will probably not make a difference that you will really notice, and can damage the battery if the temperature gets too cold (freezing)).
It's not clear why this is necessary, and on some models it may not be necessary (your post, however, suggests that it IS necessary on your model). However, there is OVERWHELMING annecdotal evidence that this is the single most important thing that you can do to have your battery last years and years, for the times when you really do need it, when you are traveling and want to use the laptop in a car, on a plane or in various transient locations.
The two likely culprits here are overcharging and heat.
While in theory the charging circuits should shut down [COMPLETELY] when the battery is fully charged, there is evidence that in many laptops they don't; they continue charging the battery continuously , albeit in a "trickle charge" mode. This may sound good, but in practice it can damage the battery.
Secondly, it is a well known fact that Lithium Ion batteries are terribly sensitive to permanent damage by exposure to elevated temperatures (and "elevated" in this case starts in the range of around or just over 100 degrees F (about 40C)).
With regard to elevated temperatures, storage in a turned-on laptop is problematic for two reasons. First, there is a lot of heat in the laptop (from the various laptop components: CPU, hard drive, power supply, etc.), and the battery is, to varying degrees, exposed to this heat (note, however, that battery exposure to this heat varies by model depending on the thermal design and placement of the battery relative to other heat generating components). Secondly, if the charging circuits do not shut down COMPLETELY, charging itself (even "trickle charging") generates heat from directly within the battery itself which is harmful over time.
Now, a few more comments:
First, it's probably not a good idea to remove the battery while you are staying in a hotel for a few days, even if you won't need it. The risk of forgetting the battery in the hotel room when you check out is significant (you can mitigate this by leaving the battery in your laptop bag, but ask anyone who uses PC Cards about "lost dongle cables").
Second, notwithstanding the general advice to remove a battery that is not needed and not being used, the battery needs to be exercised 2 to 4 times a year. So, once in a while, put it back in the laptop, draw it down to about 25% (NO LOWER!!) and then charge it back up to about 60% (or 100% and then back down to 60%; Lithium batteries store better with a less than full charge although in my personal experience I have not found the difference to really matter very much).
Third, if your laptop is really used as a compact desktop at home or at work and in fact doesn't travel much, removing the battery robs you of it's function as a "UPS". Solution: Buy a [real] UPS. For a laptop, you only need a small one (300 to 350VA), these can be found for $40 or less (sometimes even "free after rebate"), and a UPS is a lot cheaper than using a $200+ lithium battery as a UPS but destroying it over a period of 6 to 24 months in the process.
Also note that Lithium batteries have a finite and limited life in terms of the number of charge/discharge cycles, calendar time not withstanding. Although this varies by battery model, it's in the low-to-mid hundreds (say 300 to 600 cycles as a typical range). If you really are using your battery while traveling, charging and discharging it on a daily basis, this fact will "get you" no matter what you do. But, more commonly, people find that they have destroyed their battery without ever really using it, by leaving it in the laptop while the laptop was plugged in continuously. And we have already covered the solution to that problem.
One last comment, given the price of laptop batteries, it's worth noting that SOME extended warranties cover the batteries. If you are really going to be using the battery heavily (see the previous paragraph), this may be worth taking into consideration when the colored shirt guy at Buy More offers you an extended warranty at the time of the laptop purchase. Find out (IN WRITING!!) if the battery is covered, and if your use pattern is such that you will probably be going through more than the initial battery over the course of the extended warranty, maybe you are in one of those situations in which an extended warranty really does make sense.