debt/loan lifecycle could be described as:
1) origination
2) debt is outstanding; borrower makes regular interest payments and prepays (scheduled or unscheduled) if any. debt/loan is considered performing
2.1) if borrower misses interest payment, debt/loan becomes delinquent, grace period starts
2.2) grace period expires, still no payment - debt becomes distressed. negotiation between borrower and creditors kicks-off. possible resolutions (credit events):
2.3a) debt is restructured and haircut applied (if any);
2.3b) borrower files for bankruptcy and seeks protection from creditors. trustee in bankruptcy is appointed; company assets are sold off - recovered funds go to creditors. remaining debt (defaulted balance - recoveries) is considered liquidated.
3) debt/loan is fully repaid on or before maturity date
so to answer your first question - non-performing-loan starts from 2.2) grace period expiry and up until 2.3b) when debt becomes liquidated (unrecovered)
to answer your second question - debt holder has two options handling (writing off) bad debt: 1) sell it to distressed debt investors and get money back asap; 2) participate in bankruptcy 2.3b) and seek proceeds from company liquidation.
please be aware the above is just to give you a flavor/direction and the devil is in legal details