If it is part of your CTC, the ex gratia is to be paid at least once every year before 30th November, on par with the bonus payable to the employees of your company whose basic salary is less than Rs. 10,000/- and who fall under the purview of the Payment of Bonus Act.
Generally, in all new companies where the CTC concept is present, ex gratia, instead of a bonus, is included as part of the CTC for employees who do not fall under the purview of the Bonus Act, i.e., those earning more than Rs. 10,000/- in basic salary. In such cases, the employer is required to pay ex gratia to these employees as well, on par with employees eligible for a bonus under the provisions of the Payment of Bonus Act, preferably by November of each year for the bonus pertaining to the previous financial year.
In this situation, why did your employer not pay ex gratia to you every year, and why did you not ask them to pay for the past two and a half years? Moreover, in some organizations, management may not pay ex gratia to retired or resigned employees if ex gratia is not a part of their CTC. Please check and inquire with your HR Department about this. If your CTC includes an ex gratia component, then you are entitled to it, and you should ask your HR department to process the payment. Otherwise, if you wish to recover the ex gratia, which was part of your CTC, you can file a suit in civil court.
Regards