This is caused by a bad valve or an overheating water heater. This is a safety device designed to relieve pressure at the tank in the event the temperature rises too far.
Turn down the heat on your water heater. If the overheating condition still exists, turn it off altogether.
If the water heater was simply turned up too far, repair may not be necessary.
If turning down the heat level does not correct the condition, either the thermostat has failed or the pressure valve has failed. Testing the devices will help to determine which part to replace. If you want to do it yourself, a good rule of thumb is to replace the valve first, because it is much cheaper than a new thermostat.
These parts do not generally require ongoing maintenance, other than replacing them when they fail.