Potential Energy in a Uniform Field

If a mass is moved up or down a distance Dh in a uniform gravitational field directed down, the change in gravitational potential energy is:

DUg = mg Dh

We're free to define the zero for potential energy at some convenient level.

Similarly, for a charge q moving a distance Dd parallel to the field, the change in electric potential energy is:

DUe = qE Dd

If a positive charge moves opposite to the field the change in potential energy is positive. If it moves in the direction of the field DUe is negative. Just the opposite is true for a negative charge.

Again we're free to define the zero for potential energy at some convenient level. The value of the potential energy is not too important - what really matters is how the potential energy changes when the mass or charge moves.