There seems to be one national law about leave, the Factories Act, 1948 §79, which grants an adult employee 20 days of paid leave after a year of employment, assuming the person has worked the required number of days within the year. Sub-section 3 addresses accrued leave at the end of employment (for whatever reason), that he:
shall be entitled to wages in lieu of the quantum of leave to which he
was entitled immediately before his discharge, dismissal, quitting of
employment, superannuation or death, calculated at the rates specified
in sub-section (1), even if he had not worked for the entire period
specified in sub-section(1) or sub-section (2) making him eligible to
avail of such leave
In the case of a person quitting, the law continues
and such payment shall be made (i) where the worker is discharged or
dismissed or quits employments before the expiry of the second working
day from the date of such discharge, dismissal or quitting
As for accumulation of leave, sub-section (5) says
If a worker does not in any one calendar year takes the whole of the
leave allowed to him under sub-section (1) or sub-section (2), as the
case may be, any leave not taken by him shall be added to the leave to
be allowed to him in the succeeding calendar year:
Provided that the total number of days of leave that may be carried
forward to a succeeding year shall not exceed thirty in the case of an
adult or forty in the case of a child
So there is a statutory "use it or lose it" element. That said, the question is whether you are a "worker" as defined by that act. The definitions say:
"worker" means a person employed directly or by or through any agency
(including a contractor) with or without the knowledge of the
principal employer whether for remuneration or not in any
manufacturing process, or in cleaning any part of the machinery or
premises used for a manufacturing process, or in any other kind of
work incidental to, or connected with the manufacturing process, or
the subject of the manufacturing process but does not include any
member of the armed forces of the Union
Tech work is typically not considered to be "factory work" and is not obviously part of manufacturing, but writing software might be work "connected with the manufacturing process".
There is an act implemented at the state level (Maharashtra version here), the Shops and Establishment Act. Ch VII of the act governs leave: the terms are similar to the above act in terms of accrual, number of days, prior service. However the payout on termination wording is different:
If an employee entitled to leave under sub-section (1) [or (1-A)] is
discharged by his employer before he has been allowed the leave, or
if, having applied for and having been refused the leave, he quits his
employment before he has been allowed the leave, the employer shall
pay him the amount payable under section 36 in respect of the leave
The important difference is that the payout condition is conditioned on either being fired, or having applied for the leave and being refused (after which point you may resign). If you don't make a claim for leave and you resign, then the conditions of that law don't appear to apply. But, in another state, the wording could be different, so it depends on your state.
The definition of "commercial establishment" includes "legal practitioner, medical practitioner, architect, engineer, accountant, tax consultant or any other technical or professional consultant". It is possible that a different state's version of the act includes a payout requirement.