First of all, it's a water heater, not a hot water heater (if the water was hot it wouldn't need heating).
I had a similar issue with my Atwood water heater a few months ago except mine would light for about 30 seconds and then shut off. After 3 cycles of this it would quit trying and light the "Pilot out light" which is just an error light now-a-days.
Realize that the ignitor is also the flame sensor: so if it does not sense and report the flame to the controller within 30 seconds of the gas valve opening, the controller will close the gas valve and recycle for another try.
I replaced several parts including the ignitor but the problem was actually the controller board; a known weak issue in these water heaters. I replaced mine with a Dinosaur board and hot showers abound again.