Work is said to be done when force acting on the body displaces it.
Work done by gravity depends only on the vertical displacement of the body. It does not depend upon the path of the body. Therefore, work done by gravity is given by the expression,
W= mgh
where, vertical displacement, h= 0
∴W = mg×0= 0
Hence, the work done by gravity on the body is zero.