Gratuity is a one-time lumpsum payment that an employer is legally required to pay an employee as a token of appreciation for their service, typically once the employee has completed at least 5 years of continuous service with that employer, whether they resign, retire, or in some cases even if their employment ends earlier due to death or disability.
The gratuity amount is calculated using a standard formula based on your last drawn basic salary (plus dearness allowance) and the number of years you've worked, with a cap on the maximum amount that can be paid, and on tax exemption for that amount. Gratuity is meant to recognise long-term loyalty and service, and is paid in addition to your regular salary, EPF balance, and any other retirement benefits you may be entitled to.