Your water heater has a t-stat gas control in it that may have been changed or set to low not allowing it to heat as it should.
The main question is did it ever heat on gas or did this just start. if it just started and you have not changed or had anyone change anything it may have had something go bad in it.
I would get it inspected.