The general equation invloved in such physical process is:
work done = change (increase) of kinetic energy
Since [work done] = force x displacement
now, the [force] is gravitational force, which is the weight of the object mg (where m is the object mass and g is the acceleration due to gravity)
and, the [displacement] is the change of height h covered by the falling object,
thus, force x displacement = (mg)x(h)
put it back into the general equation above, we have
mgh = change of kinetic energy
Therefore, the actual fact is the term [mgh] represents the work done by gravity.