If a person pledges to God the value of a living thing… (Leviticus 27:2)
The Torah gives a standard value for a person based on age and gender. Men from age 20-60 were “worth” fifty silver shekels; women in that age range were “worth” thirty shekels. From age 5-20, the amount was twenty shekels for a boy and ten for a girl. From a month old to age five, it was five for a boy and three for a girl. After age 60, it was fifteen shekels for a man and ten for a woman. These are merely standard amounts. If someone were actually to be sold as a slave, other factors would come into play: health, strength, even their level of attractiveness. The purpose of the standard was in case a person pledged someone’s financial value to the Temple. In such a case, these standards were used.
In Hebrew, these standard amounts are called “arachin.” A person’s actual value, were he to be sold as a slave, is called “damim.” One could pledge either of these amounts. In either case, the money went to bedek haBayis, the upkeep of the Temple.
The basis of this mitzvah is that a person possesses the ability the affect the spiritual through his power of speech. By pledging someone’s value to the Temple, he makes a commitment that must be honored. (A person could seek to be released from such as an obligation, the same as with other types of vows.)
This law applies in all times and places but the Sages declared that one should not make such a commitment in the absence of the Temple (see Talmud Avodah Zarah 13a). If one did so, the money becomes consecrated and must be destroyed. (Consecrated objects could be redeemed onto a perutah – a small coin – which was then destroyed at a much smaller loss – see Talmud Arachin 29a. Regardless, one should not make vows of consecration in the absence of the Temple.)
This mitzvah is the topic of the Talmudic tractate of Arachin, starting with the first word on the first page (which is 2a). It is codified in the Mishneh Torah in the first chapter of Hilchos Arachin and is #114 of the 248 positive mitzvos in the Rambam’s Sefer HaMitzvos. This mitzvah is not listed in the Sefer HaMitzvos HaKatzar of the Chofetz Chaim.