A debtor or debitor is a legal entity (legal person) that owes a debt to another entity. The entity may be an individual, a firm, a government, a company or other legal person. The counterparty is called a creditor. When the counterpart of this debt arrangement is a bank, the debtor is more often referred to as a borrower.
If X borrowed money from their bank, X is the debtor and the bank is the creditor. If X puts money in the bank, X is the creditor and the bank is the debtor.