Please go through the Payment of Gratuity Act, specifically Section 4, which is as follows (though not in full):
Payment of Gratuity
(1) Gratuity shall be payable to an employee on the termination of his employment after he has rendered continuous service for not less than five years, -
(a) on his superannuation, or
(b) on his retirement or resignation,
(c) on his death or disablement due to accident or disease:
Provided that the completion of continuous service of five years shall not be necessary where the termination of the employment of any employee is due to death or disablement.
As long as the above is fulfilled, there should not be any issues, although an employee leaving in the fifth year after working for more than 8 months has been a subject of debate, with some considering 240 working days as the criterion.
I hope this answers the person who questioned my earlier response.
Thanks and Regards