This is a very large subject that might be too big for an answer but I will make an attempt anyway. I apologize for the length.
I think the answer to the question can be almost fully derived by this fairly long section of scripture, so I quote it all:
1At the end of every seven years you must cancel debts. 2This is how it is to be done: Every creditor shall cancel any loan they have made to a fellow Israelite. They shall not require payment from anyone among their own people, because the Lord’s time for cancelling debts has been proclaimed. 3You may require payment from a foreigner, but you must cancel any debt your fellow Israelite owes you. 4However, there need be no poor people among you, for in the land the Lord your God is giving you to possess as your inheritance, he will richly bless you, 5if only you fully obey the Lord your God and are careful to follow all these commands I am giving you today. 6For the Lord your God will bless you as he has promised, and you will lend to many nations but will borrow from none. You will rule over many nations but none will rule over you.
7If anyone is poor among your fellow Israelites in any of the towns of the land the Lord your God is giving you, do not be hardhearted or tightfisted toward them. 8Rather, be openhanded and freely lend them whatever they need. 9Be careful not to harbor this wicked thought: “The seventh year, the year for cancelling debts, is near,” so that you do not show ill will toward the needy among your fellow Israelites and give them nothing. They may then appeal to the Lord against you, and you will be found guilty of sin. 10Give generously to them and do so without a grudging heart; then because of this the Lord your God will bless you in all your work and in everything you put your hand to. 11There will always be poor people in the land. Therefore I command you to be openhanded toward your fellow Israelites who are poor and needy in your land. (Deuteronomy 15:1-11, NIV)
It may seem odd to appeal to Mosaic legislation to understand the Christian view of debts and our obligations under them, but in many ways all Christian principles are first inlaid in the Old Testament. From the verses above we can conclude two principle aspects about debts under a Biblical framework:
Both lending and borrowing are not condemned, but actually encouraged when the poor need temporary help. This is a peculiar case of a law for an agricultural society who shared the land God was giving them. Therefore, we can imagine if a neighbor suffered providential loss, due to bad weather affecting their crops, etc., a neighbor might loan his own seeds, tools, etc., recognizing that he may too need help at another time.
It is not moral to take advantage of the poor through a loan, as the principle was to forgive the whole loan, where it could not be repaid after seven years.
From these two aspects the church at a very early age condemned what was called 'usury'. Usury did not mean a high interest loan, but almost any kind of interest on 'money'. Interest was not the same thing as 'usury' but if the lender did not in some way take on risk in a loan, then it was considered usury. An excellent article on the history of interest including church views can be found at A Brief History of Interest, Dr. Jurg Conzett. The basic idea that has floated around the subject relates to the history of the world changing from an agrarian society to a capitalist trading society. When we think about it it makes sense. In the early days, such as under Moses, if you needed some seed to survive, a neighbor might lend some of his seed, or land. They did not necessarily have silver coins, so the payment for seeds would be seeds from a successful crop. It would be easy to pay a bit of interest as one seed would produce hundreds of seeds. In this way early lending was fair and the lender assumed risk, because if there was no crop, a payment could not be made, and after seven years the whole thing must be forgiven. Even Aristotle argued against interest on silver, saying that it did not naturally increase as did seed.
We can see these principles applied under the Mosaic law for among brother 'no interest was allowed' but interest was allowed for loans to foreigners:
Do not charge a fellow Israelite interest, whether on money or food or anything else that may earn interest. You may charge a foreigner interest, but not a fellow Israelite, so that the Lord your God may bless you in everything you put your hand to in the land you are entering to possess. (Deuteronomy 23:19-20, NIV)
However, even for a foreigner the interest could not be a kind of 'usury' that exploited the poor, as:
“Do not mistreat or oppress a foreigner, for you were foreigners in Egypt. (Exodus 22:21, NIV)
To apply this basic ethic to today, or with the New Testaments command that
'Let no debt remain outstanding, except the continuing debt to love one another' (Romans 13:8) we can draw the same principles under the gospel light.
First, any loan by a person in need is lawful, in order to help the person make a living and take care of his own family. Second, such a loan should be provided for without exploitation. Yet we live in a wicked world, so this is not always possible as that would pretty much end all credit-card usage today as they all charge high interest especially among the poor!
As the New Testament is not under a government of God's people following God's laws in Canaan but an invisible church in a wicked world, the New Testament seems to focus more on charity, rather than loans by Christian love, as well as Christian duties for those who have debts in this wicked world. Therefore, for those with debts, the command is to not forsake the obligation of paying them, but work hard at being faithful to our commitments. It also implies that we must not enter into debt unless necessary:
The wicked borrow and do not repay, but the righteous give generously (Psalms 37:21, NIV)
The only way we can really determine what debts or lawful, is not under a legalistic rule, but under the rule of love, which must define all principles of godliness. The question we should ask ourselves when entering into a debt obligation is: 'Can we truly incur and repay this loan, without causing anyone harm?' If the answer is no, then the debt is not lawful, for love is the law.
A student loan, to become employed and a productive member of society would naturally be a good debt, for without such many could not earn income for a family or support church ministries and other charities later in life. A loan to borrow from your next years predicted savings, to go on a vacation because you are stressed might not pass the rule. The New Testament drives the idea of obtaining an 'independence' and respect from the outside world, which is included in working towards having no debts, where possible:
And to make it your ambition to lead a quiet life: You should mind your own business and work with your hands, just as we told you, so that your daily life may win the respect of outsiders and so that you will not be dependent on anybody. (1 Thessalonians 4:11-12, NIV)
I myself once took a loan to pay for expenses necessary to adopt an orphan. I would consider that a good loan. The question we must ask ourselves when considering to take on a loan, is: 'Do we really need now what we want the loan for, for the benefit of ourself, our family and our brother?'