Forgiving loans owed to us by other Jews is both a positive and a negative mitzvah. The negative was in Mitzvah #475, which forbade us from trying to collect such debts. The positive is here, the commandment to consider such loans canceled.
The reason for this mitzvah is as we have stated: it makes us better people. We train ourselves to be more generous and to respect God’s laws when it comes to property rights. If we can accept not to collect on loans (which we would normally consider rightfully coming to us), we’ll certainly never be lured into burglary or theft.
Biblically, this mitzvah applies when the Yoveil is observed; rabbinically, it applies in all times and places. In the Mishna, it is discussed in the tenth chapter of tractate Sheviis; in the Talmud, in tractate Gittin (36a-37b) and in Makkos (3a-b). It is codified in the Shulchan Aruch in Choshen Mishpat 67. This mitzvah is #141 of the 248 positive mitzvos in the Rambam’s Sefer HaMitzvos and #64 of the 77 positive mitzvos that can be fulfilled today as listed in the Sefer HaMitzvos HaKatzar of the Chofetz Chaim.