In this case, the force of gravity is acting in the downward direction. But, the displacement of the body is in the upward direction. Since the angle between the force and displacement is 180o, the work done by the gravitational force on the body is negative.