A thermocouple lead should produce at least 20mv of electrical current in order to be strong enough to hold the magnetic valve in the gas control open to allow gas to flow to the pilot burner, any less than 20mv would result in the same problem you are experiencing. If however, once you get the pilot to light and the main burner comes on if the water heater pilot burner goes out immediately once the water has reached the set temperature then for sure your gas control valve is faulty as it is going out on the inbuilt overheat setting. The only cure for this problem is a total gas control valve change.
Hope this helps you.
Remember – Get a qualified gasfitter to undertake the valve change as gasfitting work undertaken by those not qualified often leads to leaks and fires.
Selgas Services Ltd
Craftsman Gasfitters, Plumbers, Electrical Service Technicians