Many times this problem is because the thermocouple has developed a bad seating connection between the thermocouple fixing nut and the Thermo-Electric valve located inside of your actual control valve assembly.
Meaning the connection between the end of the thermocouple wire just above the thermocouple fixing nut and the seat which is inside the Thermo-Electric valve have a bad connection that does now allows current to pass through the connection and into the Thermo-Electric valve.
When you have a good connection here it allows the control valve to stay open and allows gas to pass through the control valve into both the pilot and the main burner, but if this connection is bad then each time you release the button the pilot light will goes out.
Now to try and resolve this service problem with having to purchase new and sometimes expensive parts.
Remove the thermocouple wire from the gas control valve Thermo-Electric unit by turning fitting counter clockwise with a 5/16 wrench
Once the thermocouple fitting has been loosened and the thermocouple has been removed inspect the thermocouple Power Unit Connector Contact (PUCC).
Although the PUCC may appear clean may times the PUCC has developed a thin layer of corrosion that prevents the thermocouple from sending the needed current to the Thermo-Electric unit resulting in a pilot flame that may only remain burning strong as long as the pilot button is being pushed by the operator.
After removing the thermocouple PUCC from the valve you will need to clean both the power unit connector contact and the Thermo-Electric valve seat contact.
The connecting will require that a small amount of new "Clean Metal" be exposed providing a new fresh metal seat for the PUCC and the Thermo-Electric valve.
With a safety blade or a metal pick expose some new metal on both the PUCC and then up inside the Thermal-Electric valve seat scraping just a small amount of old surface from each item.
Now reassemble the thermocouple wire back into your gas control valve and tighten the nut firmly to achieve a good solid seating connection.
This new fresh metal seat should allow the millivolt current generated from the thermocouple to energize the Thermo-Electric valve and allow the gas control valve to remain in the open position.
If this does not work you may need to order a ned Pilot/ODS assembly.
You can find that at www.msservice.net