The cancellation policy/charges are governed by the Indian Railways rules and depend on various factors such as:
a.The status of the ticket
b. Time of cancellation of tickets,
c. Status of the train
In certain cases post chart preparation, the online cancellation of e-tickets is not allowed and customers will have to file TDR within certain time period. However, in the case of train cancellations, you are eligible to receive a 100% refund of the ticket fare (please note some charges such as IRCTC convenience fee, Payment Gateway charge, Service Charge) may be non-refundable.
For complete information on the cancellation charges/rules and refund policy, please refer to this document of IRCTC / Indian Railways.