Work Done by the Force of Gravity
A mass m being lifted to a height h and the same mass being lowered by a distance h. The weight of the object is mg in both cases.

When the work is done against the force mg (downwards) and the displacement is upward (θ = 180º). Therefore,
W = Fd cos 180º = – mgh
When the mass is being lowered, the force mg and the displacement d are in the same direction (θ = 0º). Therefore, the work done
W = Fd cos 0º = + mgh
When the object is lifted up, the work done by the gravitational force is negative but the work done by the person lifting the object is positive. When the object is being lowered, the work done by the gravitational force is positive but the work done by the person lowering the object is negative. In both of these cases, it is assumed that the object is being moved without acceleration.