If you turn off the water main for an extended period, you should turn your water heater off. If the water will only be shut down for a short time, there is no need to turn off your water heater.