Hajj is not obligatory except on those who are able to perform it. This includes physical and financial ability. Therefore, Hajj is not obligatory on a person who is in debt. However, if a person has a long-term loan (and of course without interest) and he is required to pay only a certain amount each month, then his debt is only that which is due each month. If he pays off all the debt and then nothing is left with him to make Hajj, then Hajj is not obligatory on him.
Muslim Jurists have unanimously agreed that Hajj is obligatory upon anyone who is able to perform it, based on the verse in which Allah says: “Pilgrimage thereto is a duty men owe to Allah, those who can afford the journey…” (Aal `Imran 3: 97).
Before going to Hajj or `Umrah one should relieve himself of obligations towards others, his trusts and debts. If one is in debt, he can not go for Hajj as this debt is the right of the creditor. However, if the creditor allows him/her to go for Hajj or `Umrah (and of course there is no interest in the loan), then he/she can perform Hajj or `Umrah. But in case these loans incur interest, then you have to repay these loans as soon as possible before going to Hajj to reduce the involvement in interest.
Elaborating more on this, Dr. Monzer Kahf, a prominent economist and counselor states: “It is always permissible to go for Hajj or `Umrah while under a Loan, if it is without interest and if you can afford to spend on Hajj or `Umrah without negatively affecting your ability to pay the loan back.
Interest-based loan, if not taken out of necessity that relaxes the prohibition, is one of the most grave sins from Shari’ah point of view and it is always much better to rid oneself of sinful conditions before going for Hajj or `Umrah. This means that the Shari’ah advice would be to pay off the interest loan in full instead of spending the money on Hajj or `Umrah. But if you decided to go for Hajj or `Umrah it is permissible and acceptable, InShaAllah, while you are still under a sin that invokes a war from God and His Messenger as the Qur’an [2: 279] tells us. This is because each action is reckoned on its own.”
Allah Almighty knows best.