Work done by the force of gravity on an object depends only on vertical displacement. Vertical displacement is given by the difference in the initial and final positions/heights of the object, which is zero.
Work done by gravity is given by the expression,
W = mgh, where, h = Vertical displacement = 0
W = mg × 0 = 0 J
Therefore, the work done by gravity on the given object is zero joule.