An oven thermocouple is a small probe that terminates directly over the opening of the pilot assembly. A tube protecting two wires leads from the probe to the top of a safety valve, mounted on the gas line between the oven thermostat and the pilot assembly. The two wires leading from the probe are made of different metals, allowing the probe to detect temperature variations based on changes in the voltage running between each wire.
T.J. Seebeck discovered in 1831 that heating one junction of a closed circuit made of two different metals causes electric current to flow through the circuit. The greater the difference between the hot and cold junctions, the greater the magnitude of the current. While small, this electrical current can be used to perform work, such as opening or closing a valve based on the temperature at the hot junction or probe end of the thermocouple.
The hot junction of the thermocouple in a gas oven is enclosed in a probe that rests inside the pilot flame when it is lit. The cold junction is in a cooler part of the oven, so as long as the flame is lit, current runs through the thermocouple circuit. This current holds the safety valve on the gas line in an open position. If the pilot flame goes out, the temperature of the hot and cold junction equalizes, current stops flowing through the circuit, and the safety valve closes, cutting off gas flow to the oven.
Confirm that your oven has a thermocouple by finding the probe located over the pilot flame assembly. If the pilot flame will not stay lit, make sure that the tip of the probe rests in the flame itself. Assuming it does, the problem may be a defective thermocouple, a bad connection between the safety valve and the thermocouple or failure of the electromagnet that holds the safety valve open when current is flowing through the thermocouple.