Firstly: Defining the Indebted
Gharim linguistically: is the indebted. Gharim is used for both the indebted and the lender. The origin of ghurm semantically is persistence and inseparability. From this is His saying, exalted: "Indeed, its punishment is persistent" They are referred to individually as gharim as they are inseparable from one another. It is also said that ghurm is loss, as the gharim loses his wealth.
Gharim legally: is the indebted and unable to repay his debt.  It has also been said: that it is the one who owes more money than he owns, or equal to it, or just less than it. It is also said: it is the one whose debt overwhelms him, and the money borrowed is not used for corruption. It is also said: it is the one who will have no nisab if he were to give back the debt. It is also said: it is those whose wealth does not suffice their debts.
Secondly: The Indebted as an Avenue for Charity Expenditure
There is a share from charity that is for the indebted who are unable to pay back their debt. Consensus has been quoted on this by: Ibn al-Mundhir, Ibn Qudamah, al-Qurtubi, and Ibn Taymiyyah.
Thirdly: The Indebted to Settle Disputes  The indebted to settle disputes is he who borrows money to settle some dispute, like fearing fitnah between two tribes or groups or persons, so he borrows money to spend on settling it and avoiding said fitnah.
Among the indebted who deserve charity are those who borrow money to settle disputes between two or more parties, even if they are wealthy. This is the position of the Shafi`is, Hanbalis, a position among Hanafis, and it is the choice of Ibn `Abd al-Barr, Ibn `Uthaymin, and Ibn Baz.
Fourthly: The Indebted in Haram
The one indebted in haram is not given from this share of charity. This is by agreement of the four schools of jurisprudence.
Fifthly: The Indebted in Haram then Repented
The one indebted in haram then repents from it is given charity. This is the correct position of the Shafi`is, a position among Hanbalis, a position among Hanafis, Chosen by Sind from the Malikis and Ibn `Uthaymin.
Sixthly: Cancelling the Debt on the Indebted Poor
Whoever has lent money to a poor person then frees him from it with the intention of making it charity, then this does not suffice him. This is by agreement of the four schools of jurisprudence: Hanafis, Malikis, the correct position among Shafi`is, and Hanbalis.
Seventhly: Giving Charity to the Indebted
If one gives his charity to the one who owes him money, who then returns it to him to repay his debt without him making this an initial condition, then this is permissible and sufficient for charity. This is the position of the majority in general: Hanafis, Shafi`is, Hanbalis, and one of two views among the Malikis.
Eighthly: Charity to the Indebted with the Condition of its Return as Repayment
It is invalid that one gives charity to the one who owes him with the condition that he uses it to repay him, and one's charity is not absolved through this, nor is it valid for a debt to be repaid in this manner. This is explicitly mentioned by the Shafi`is, Hanbalis, and it is chosen by Ibn Taymiyyah and Ibn al-Qayyim.
Ninthly: Charity to pay the Debt of the Deceased
Scholars have differed over repaying the debt of the deceased from charity according to two views:
The first: is that it is impermissible to repay the debt of the deceased from charity. This is the position of the Hanafis, Hanbalis, Ibn al-Mawaz from the Malikis, and it is a position among Shafi`is. It is also the chosen view of Abu `Ubayd al-Qasim ibn Sallam and Ibn `Uthaymin.
The second: is that it is permissible to do so. This is the position of the Malikis, a position among Shafi`is, the chosen view of Ibn Taymiyyah, the verdict of the Permanent Committee, and the decision of the Islamic Fiqh Academy as part of the Organisation of Islamic Cooperation.