Potential energy = mgh
where
m = mass
g = acceleration due to gravity
h = height
So more the height higher the potential energy
also
more the mass (amount) of water higher the potential energy
acceleration due to gravity is a constant for earth.
hence we can say that
The amount of water released through the dam and the dam's height account for the potential energy.