If storing a laptop/portable Mac you should always remove the battery. Batteries should be fully charged (if functional) to ensure their design capacity doesn’t degrade over time. Older batteries such as Ni-MH (Nickel–metal hydride) can leak and corrode components and should always be removed. This can still occur for older batteries even when removed if the original battery cells haven’t been refurbished.
Li-ion (Lithium-ion) batteries do not leak but should be removed anyway to preserve their design capacity and shelf-life.
The image below is a PowerBook 1400 battery in the early stages of leaking. The battery acid had begun to corrode the components inside and would have made it’s way to the PowerBook’s internal components if left any longer.
Clock batteries should always be either removed or replaced. They leak onto the logic board over time and destroy the computer.