This is usually due to a sediment buildup in your tank. As water heaters grow older, they accumulate sediment and lime deposits. If these deposits are not removed periodically, the sediment will create a barrier between the burner and the water, greatly reducing the water heater's performance level. At least once every three months, drain water from the tank. Draining a gallon or so on a regular basis helps remove the sediment.
You should also periodically inspect your water heater burner. The flame under the heater should appear blue with yellow tips. If it’s mostly yellow, or if it’s sooty under there, your flue may be clogged, which is a dangerous situation. Contact a professional to check it out. At least once every two years, have your water heater inspected by a service technician. He or she will also check the drain valve for signs of leakage, and the anode rods for corrosion.