work done by any force is the dot product of the force vector acting on the object and displacement vector of the object. hence work done is given as
W = F.d
where F = force vector , d = displacement vector
when the block is suspended from a string at rest , there is tension force on the block in upward direction and gravitational force by earth in down direction.
since the block is not moving and is at rest , hence displacement of the block is zero.
so the work done by the gravitational force is zero as work done is product of displacement and force