Before we can answer your question we need more information.
You say it is leaking from the top.
Where do you see the leak showing up?
Where do you see water actually leaking / dripping out of?
There are three pipes screwed into the top: the cold supply inlet, the T&P valve, and the hot outlet. Plus the anode rod is screwed into the top.
Is water actually coming out around one of those fittings at the top of the tank?
Is water dripping onto the top of the outer housing from a fitting or valve above?
Is water leaking from from one of the elements through the side of the water heater?
Please provide additional information as best possible.