A dry cell is a type of electrochemical cell that is used in low power portable electrical-devices (example transistor, radio, torch, calculator, etc.).

In order to understand the answer of the present question, we need to understand a little bit about the working mechanism of a dry cell. Energy is formed due to chemical reaction in the dry cell.
In a dry cell, there are 2 rods, one rod is anode (positive) and the other rod is cathode (negative). Following reaction occurs in a cell.
Zn + 2MnO2 + 2NH4 ➜ Mn2O3 + H2O + Zn2 + 2NH3
Due to these reactions, chemical energy is converted into electrical energy. This energy then flows through the outer circuit to the battery-connected device.
Why cells do not work after some time if not in use for long –
In the dry cell, for anode carbon rod is used while for cathode zinc rod is used.
Zinc is not pure, it contains impurities of iron, carbon, etc., which act as a small local anodes. This is a kind of short circuit which is formed inside the cell. These reactions take place even when the cell is not in use. This caused the Zinc to get exhausted. Therefore, the cell slowly dies out.