For various reasons an Israelite might have bought a fellow Israelite as a servant, such as redeeming him who was taken in war, or he had lost everything in a disaster, or whatever, yet, the Lord set limits on how long this could last, saying,
“If you buy a Hebrew servant, he shall serve six years; and in the seventh he shall go out free and pay nothing” (Exodus 21.2).
They had to remember that a Hebrew servant was indeed a fellow Hebrew, and buying him as a servant was to help him, and the buyer had to release his brother in the seventh year, for seven means something to our God, and for whatever reason the purchase was made, six years were enough to fulfill the reason, and in the seventh year that servant could then go free without paying a thing.
The Lord knows the bad situations that we can find ourselves in, and He wants, whether brothers in Israel, or brothers in the church, to care for one another, and not to take advantage of a brother.
The release in the seventh year shows the compassion of God.