How water heaters are designed to always be on. Otherwise, they would have better ways to turn them off than cutting off power at the source. If you turn it off for a period of time, the heater must use more electricity to heat the water, possibly more electricity that it would have taken to keep the water at temp, depending on usage. 40 gallons of water will take quite a bit of time to heat up, so you will need to turn it on quite a while before you actually need it, depending on how long it has been off.
Plus the energy spent to heat the water will be disproportionate with the usage - if you need 10 gallons of water for a shower, the heater still has to heat all 40 gallons.
You may also be shortening the life of the heater by turning it off often.
So it's impossible to say deterministically how much electricity you'd save by turning it on or off. My suggestion would be to actually keep it on all the time for a few months and see how much more electricity you use compared to your current method. My guess is you're not saving as much electricity as you think you are.
Another option if you're really concerned about electricity usage is to purchase an on demand heater that only heats water when you ask for it.