The thermocouple is a device which uses temperature to operate a switch. In older gas ovens, the thermocouple uses the heat of your pilot light to either allow the gas to flow when the pilot light is lit or to shut off the gas in the case that it is not. When a thermocouple goes bad, it has to be replaced, or the oven just won't work.
When a thermocouple is working properly on your oven, the pilot light heats a sensor on the device inside of which two different types of metal wires are welded together. T. J. Seebeck was the first to discover that an electrical current can be generated between distinct metals when they are at two different temperatures in 1831 [NSH Heaters]. The charge generated by the oven's pilot light powers a solenoid that opens the gas valve in your oven.
Heat the sensor
WIth ovens that require the user to hold the pilot light button on for a while, the time spent holding the button in lets the thermocouple sensor heat up to the degree that the gas valve opens and the pilot light can stay lit on its own.
When a thermocouple goes bad, your pilot light will not remain lit and it won't be possible to use the oven. If your pilot light will not remain lit, a likely culprit is the thermocouple.
Replacing a thermocouple
Thermocouples are not difficult to replace. As with any repair involving gas appliances, take special care if you plan to replace the thermocouple yourself. Turn off the gas supply to your oven before doing any repairs. If you smell gas, take all cautions by opening windows, evacuating the premises, and calling a professional.