A diode that protects a transistor, switch, relay contact etc. when switching DC powered inductive loads (relays, motors etc) is called a flywheel (or flyback) diode.
A flywheel diode is often required, because when the current through an inductive load is suddenly broken, a back EMF will build up as the magnetic field breaks down, and if there is no path for the current, a high voltage builds up. The high voltage can damage a transistor or cause arcing in a switch. The flywheel diode is connected in reverse across the load, and provides a path for the current so the magnetic field and current can safely decline.
Sometimes a resistor is connected in series with the flywheel diode, for example when the load is a relay coil. This improves the release time of the relay.
In the illustration below, L is the inductive load, D the flywheel diode and T the transistor.
L C ^ D
- -----| T
Flywheel diodes are not useful when switching AC current. Instead a snubber network (an R-C network) may be used.