Please supply the model number and year it was made. It helps us help you with better responses.
Not knowing which vintage you have, if the flame chokes out now and then, it could range from insects nesting in the burner tube to an all-gas control valve acting up (a gas supply issue). If you are on electric ignition, there could be other issues with loose wiring, dirty connections, etc (an electrical issue).
Does the furnace work correctly, and do the range top burners burn smoothly for as long as the water heater runs and then acts up? Need to determine if you have a gas supply/control issue with the heater? If the main tank regulator is acting up, the water heater can follow it. We need to eliminate what does work right and what does not.
Hope this helps
John
2005 Ford F350 Super Duty, 4x4; 6.8L V10 with 4.10 RA, 21,000 GCWR, 11,000 GVWR, upgraded 2 1/2" Towbeast Receiver. Hitched with a 1,700# Reese HP WD, HP Dual Cam to a 2004 Sunline Solaris T310R travel trailer.