Potential energy in a uniform force field
In a uniform force field (or simply uniform field), the field strength and direction of the field are the same at all points.
While most force fields in the real world are non-uniform, they can be considered to be approximately uniform when considering points which are close together.
The gravitational field along small distances (relative to the size of the earth) near the surface of the earth can be considered to be a uniform field as the distance between the surface of the earth and the atmosphere is small (relative to the radius of the earth).
In a uniform field, the potential energy of an object decreases linearly as the object moves away from the source of the field. This is because all fields extend from a region of higher potential to a region of lower potential.
An object gains potential energy if it moves in the opposite direction of a force field and loses potential energy if it moves in the same direction of the force field.
An object which falls from a certain height loses gravitational potential energy. Equivalently, throwing an object upwards from the ground causes it to gain gravitational potential energy.