A leaking water heater shut off valve requires some fairly swift attention. Repairing the shut-off valve is not difficult, but ensure that you have the correct tools.
Step 1: Drain the Water Heater
Close off the water supply tap to the water heater and allow the water in the unit to cool down.
Step 2: Turn Off the Gas
Using a submersible electric pump and sufficient piping (depending on the pump inlet/outlet diameter, a garden hose will be as suitable and possibly less expensive), drain the water into the closest or most continent container / bath / garden. Draining the water heater will prevent water from spilling when the shut-off valve is removed for inspection. Then, remove the gas line from the water heater for added safety while working on the water heater.
Step 3: Check the Sensor
It makes sense to check that the sensor which plugs into the shut-off valve is functioning optimally. In some cases, the sensor might have been damaged and will need to be replaced.
Step 4: Loosen the Shut-Off Valve
Shut-off valves are secured at both ends to the supply pipe by a sealant or by bound tape. A leak around the shut-off valve invariably means that either the sealant or the tape is no longer functioning correctly. Use a pipe wrench to hold the water supply pipe and a second to loosen the shut-off valve. Always use the correct tools or you will cause damage to the valve.
Step 5: Check the Seal
Remove the shut-off valve and examine where the tape or sealant/compound was applied. Check the O-ring, as this may have become brittle or have developed cracks over time. Should the O-ring be damaged, it is simple enough to replace with a new unit. Then, clean the tape or the sealant/compound from the fittings and apply new tape. The sealant or tape may not have been put on correctly in the first place, and over time, water eventually began to leak from the valve. Apply either the sealant or tape generously to the threads and return the shut-off valve to the supply line. Secure the valve tightly by turning it with the appropriate size wrench until you feel suitable resistance.
Step 6: Turn the Gas On
Reconnect the gas line and plug the sensor (new or original) back into the valve. Then, refill the water heater. Now, turn on the water supply and allow the water heater to fill. Turn the gas back on.
Step 7: Test
Manually raise the float valve and check if the heater shuts off automatically. If this is the case, and the seals around the shut-off valve are holding, your water heater will be functional once again.
Ensure that you have the correct tools and materials such as tape, sealer, and O-rings before turning your water heater off. Should you find that you are missing something halfway through the procedure, it will make the task much more messy and drawn-out.