Dear Vikas,
First, the Payment of Gratuity Act, 1972 should be applicable to your establishment.
Second, there should be termination of your employment after your rendering a continuous service of not less than 5 years in the same establishment on account of your resignation or retirement or retrenchment or dismissal of your service by your employer. The minimum service is not required in cases of death. In case of dismissal on account of certain misconducts, your employer is empowered to forfeit your gratuity either fully or partially after issuing a notice.
Third, the amount of Gratuity has to be calculated on the basis of the sum total of basic pay and dearness allowance of the last drawn wages only or the entire sum if the wages are consolidated.
Fourth, the maximum amount of Gratuity is Rs. 20 lakh and it is not taxable.
Fifth, you are entitled to gratuity only for those years in which you have completed 240 days of continuous service during the entire service.