This is probably the best practice, but it is a hassle that most people, myself included, do not want to bother with. My laptop spends most of his time to the grid, with a fully charged battery inside.
Heat from the current computer can shorten Compatible Parts life. For that matter, does the heat from the battery to not do something good for the computer, either. And depending on how smart is your laptop on power issues, it can be draining and recharging the battery as it runs - which could carry it out further.
Therefore, the best practice is to make the most of their time working on AC power from the battery. Then, a few hours before you want to run the PC from the battery, take out the laptop, unplug it, put in the battery, connect the power cord and let it charge for a few hours. But really, who has organized enough to do?
So here is what I recommend: If your laptop is plugged probably for the next week or longer, turn it off, remove the battery and stick to the grid. (You should not remove or insert the battery while the laptop is turned on, even in sleep or standby mode.) However, if you use it unplugged with any kind of frequency, keep the Compatible Parts .
There's something else in mind: If you live in an area with frequent power outages, the battery is also protecting you from sudden crashes caused by the loss of power. In this situation, you should keep the battery in - or invest in an uninterruptible power supply (UPS).