There were several classes of labor "contracts". Indentured servants were free persons who signed a contract where they worked for a set period of time, under relatively regulated conditions, and were free at the end of their contract. This was a way for the laborers to get their fees paid to emigrate to a new country, and frequently a cash bonus and land at the end of it. Depending on a number of factors indentured servants were basically free citizens, since voting often had property qualifications they did not vote, but were otherwise legally equal. On the opposite end were chattel slaves who were property, and were legally no different from livestock. They had no rights, the masters could do whatever they wanted to them (restrained only by social customs), their offspring were property as well from the moment of birth. In between you had systems like debt peonage, common in Latin countries, where the peon owed money to his "employer" and was legally bound to their employment until the debt was paid off and the debt was transferrable to offspring upon the death of the initial debtor. The peon was not property and from a legal standpoint the creditor could not sell them, or impose the sorts of actions one could to slaves. Then there were serfs, which existed in Russia until the mid-1860s, where the peasant was bound to the land, the land was owned by the noble. There were elaborate sets of rights and obligations between the two (details varied by country). Generally serfs were not sold, but they could not leave the land/service of their noble.
Slaves and serfs had no way "out". Peons could, at least in theory, pay off their debt. Indentured servants had a time limit on the contract (usually no more than 7 years). In practice, the the American south, some slaves could earn actual money for certain work (an incentive process), and could purchase their own freedom if the master was inclined to let them buy their way out - it was not required he do so. This did happen, but was relatively rare. Other places and times even this small window did not exist for slaves. Serfdom was a feature of feudalism, what killed off serfdom in most of Europe were the episodes of the Black Death which created a huge labor shortage due to the death of around a third of the population. This put the nobles in competition for the labor, and willing to not return runaway serfs and also to make better deals to keep them happy. Towns needed labor and would prevent nobles from taking back runaway serfs.
For completeness sake I'll throw in the apprenticeship system. Here young men/boys would be apprenticed to a craftsman until they reached a certain age. Conditions of apprenticeship in terms of food, shelter, work hours, were contractual and often standardized by the guild in an area. In return for his labor the apprentice was taught the skills of the craft. In general the apprentice worked his butt off, but usually conditions were OK for the time (exceptions of course) and ended up with a skill/craft and an entree in to the guild system as a journeyman.