A bank may "write off" a debt at any stage it chooses; the criteria for a bank to do so will be a purely internal business matter and may depend on the size of the debt and the time required to chase repayment, amongst other reasons. There is no legislation that can force the bank to write off the debt, only to make it impossible to pursue repayment through the courts once a period of non-pursuance has passed [Limitation Act 1980; Limitation (Northern Ireland) Order 1989; Prescriptions and Limitations (Scotland) Act 1973].
Also consider that the banking industry tends to use a different definition of "write off" to that used by the general public:
Joe Bloggs may think "write off" = cancel, as if it never existed.
Banks think "write off" = pass debt to collection agency and place default on credit file.