Temp changes and extreme temps will shorten battery life, usualy when you have the laptop plugged up your gaming or doing something a bit more cpu/gpu intensive and are possibly creating more heat, which in turn can cause damage to the battery, especialy with newer laptops as they run much warmer.
The best thing to do, depending on your battery, is to take it out when it is NOT needed, and charge only when the battery gets to a point where the laptop will turn on but windows starts to warn about the battery life, then let it charge completly with out the charger being removed.