Pyroelectricity is a property of certain materials (especially crystals which are naturally electrically polarized) to generate a temporary voltage when they are heated or cooled.
The change in temperature modifies the positions of the atoms slightly within the crystal structure, such that the polarization of the material changes. This polarization change gives rise to a voltage across the crystal.
If the temperature stays constant at its new value, the pyroelectric voltage gradually disappears due to leakage current (the leakage can be due to electrons moving through the crystal, ions moving through the air, or current leaking through a voltmeter attached across the crystal).
Pyroelectricity should not be confused with thermoelectricity, a different thermal effect with a different mechanism.