A thermocouple is a whole piece with a long section on one end and a screw on the other end. They are usually available at HoDePo.
The problem might be a thermocouple, but it might also be another safety device in the circuit called an electrical cut off (ECO.) Changing parts alone doesn't always solve a problem as some cleaning and adjustment might be necessary.
Thermocouples 30-60 millivolts satic 15-45 millivolts working most valves will hold down to 6-8 Millivolts
As most argumentative DIY's say; it isn't rocket science; but then is anything but ... rocket science?
One important point with a thermocouple is to thread the round button end of the thermocouple into the gas valve with the fingers. If it isn't going into the hole the old one went into easily, then you are trying to fight the threads at an odd angle. Once you get the end to seat with the fingers and gently snug the end with a wrench, tighten it further 1/8th to 1/4 turn. You are just trying to make an electrical connection there; not tighten a pipe. More, and the end can distort and possibly break the gas valve. The stuff before that is pretty much replacing the thermocouple just as you see the old one that is on it now.
well it may or may not be the thermocouple below is just some of what it could be.
first you need to check that the pilot is on(lit)has it a correct size and flame pattern and is playing the thermocouple in the right place there is a hot and a cold spot on a thermocouple and it will not work if the cold spot is heated or the hot spot cold
2)Thermocouple may not be given right voltage
3)magnetic valve faulty
4)contacts could be dirty stopping voltage
5)interlock like The E.C.O. may have failed or operated
6)pilot flame may blow out from the main burner lighting or turning off (pilot in wrong place)
7,8,9....... and so on and on
GET A SECOND LICENCED GASMAN TO CHECK IT OUT
If he doesn't have his volt meter and his gas pressure meter in hand
as part of his kit hes not the one you want
"Buyer beware" and "You get what you pay for" apply here
There are two tests to be made. The thermocouple must be tested to assure that when the pilot flame is applied, the thermocouple creates the required millivolts to hold the pilot gas open. This requires a millivolt tester while the flame is applied. There are tools available to do this test from Honeywell at the local supplier.
Once the thermocouple is tested and found to be OK. then the thermocouple is applied to the gas valve. The connection at the gas valve can be tested for continuity to see if it is broken or not using an ohmmeter. If there is continuity, the gas valve should hold open from the thermocouple current.
I would be surprised if thermocouples and gas valves would have problems from the factory. Most suppliers will not accept electrical control parts back, as it is the contractor's responsibility to test that they are receiving good parts. A supplier can not run a business with the expectation that electrical parts will be used as test devices by inexperienced novices until they are successful at performing the most basic of technical repairs.