Hot Water Heater 101 ...
The diptube is another name for the cold water inlet which is used to deliver the incoming cold water toward the bottom of the hot water tank.
This helps to prevent the cold, denser water from mixing with the hot water which is lighter and remains in the upper portion of the unit.
Dip tubes that have broken off or leaking inside the hot water tank allow the cold water to mix with the hot water. This is one reason why it will seem like the hot water does not last as long.
While there is no hot water being used the temperature inside the tank will be fine until there is a demand for hot water. Depending where the diptube is leaking will determine how much hot water is available before it starts cooling off. The cold water entering the tank will start mixing with the hot water lowering the temperature.
When a dip tube breaks down inside the hot water tank, small plastic chips or flakes (pieces of the dip tube) may enter the household piping, get caught in the aerator screen at the tap and block the flow of water. Depending upon the manufacturer, some of the dip tube particles float, some sink and some may appear greenish or tan coloured.
While the chips do not pose a health risk, since they clog household faucets and appliances and diminish the heater efficiency and effectiveness, the dip tube should be fixed.
Another reason is .... sediment buildup in the tank.
As water heaters age, they tend to accumulate sediment and lime deposits. If the heaters are not cleaned periodically, the sediment may rise to a level that will act as a barrier between the burner and the water, making it harder to heat. For every half inch of sediment on the bottom of a gas fired water heater, it requires about 70% more fuel to heat the water.
For an electric heater ... one of the elements is not functioning.
Check this link : http://home.howstuffworks.com/water-heater1.htm