Most likely, water heater lines are damaged, causing the top leak. So, you will want to inspect each of your lines for corrosion, breaks,or kinks. Replace as needed.
Turn OFF the electric/fuel & water-supply to your water-heater;
Carefully drain your water-heater tank;
Contract a locally-licensed plumber to replace your water-heater.
Have plumber periodically replace your water-heater's sacrificial-anode.
Drain & replace your hot-water-heater.
Unfortunately,
When "temporary"-patches are applied to the outside of water-leaks,
they usually do not hold,
just not a strong-enough-bond against the constant & varying pressures.
Check all the pipe's running in and out.Also look for condensation on pipe's that could be running down on top of the water heater.If the heater is leaking from the top of the unit it's self it will have to be replaced.
You should call a plumber immediately when your water heater is leaking from the top. It is time for a new water heater. The water heater is broken inside and the pressure is pushing the hot water up so that it is leaking out of the top. The structure of the heater is compromised and at risk for rupture.
You should call a professional to make sure that there is not something seriously wrong. You should probably try and rig something to keep it from happening in the meantime.
Water heaters often leak, but if it's leaking from the top your screwed. I really have no solution to that other than to turn the water heater up until it blows.