You can immediately resign. Unless the Articles of Articles of the company concerned contain any specific provision about acceptance of resignation by the Board of Directors of the company, the resignation from directorship takes effect immediately, i.e., from the date of the resignation letter.
You do not have to pay towards the Companies' liability (unless it is a Criminal/ Fraud Liability against you) nor can you claim in the assets of the Company.
The Companies Act restricts the ability of a company to indemnify its Directors and officers against losses. The Companies Act, however, does not prevent a company from taking an insurance policy for its own protection against loss caused to it by its Directors. Further, the Director can take out a policy to re compensate the loss he suffers because of his liability to the company. The premium for such policy may be paid by the company itself.