Let a boy of mass m climb up through a vertical height h either through staircase of using a lift. The force of gravity on the boy is F = mg acting vertically downwards and the displacement in the direction opposite to force (i.e., vertical) is S = −h. Therefore the work done by the force of gravity on the boy is
W = FS = − mgh
or, the work W = mgh is done by the boy against the force of gravity.