Each year on November 21, both Catholic and Orthodox churches celebrate the Presentation of the Virgin Mary in the Temple (also known as The Entry of the Most Holy Theotokos into the Temple). While originally this day marked the dedication of a basilica in Jerusalem, it quickly became associated with this extra-biblical event, not found in the New Testament.
The feast is based on an ancient text from the year 145, called The Protoevangelium of James, a text that was revered by early Christians. In it, we find the Virgin Mary's parents entrusting her to the Jewish Temple at an early age. According to Fr. Alban Butler, this was a custom of some Jewish parents at the time, "Religious parents never fail by devout prayer to consecrate their children to the divine service and love, both before and after their birth. Some amongst the Jews, not content with this general consecration of their children, offered them to God in their infancy, by the hands of the priests in the temple, to be lodged in apartments belonging to the temple, and brought up in attending the priests and Levites in the sacred ministry."
While the historicity of the document has been questioned, the event has always been a day for religious men and women to consecrate themselves to God, in imitation of the Virgin Mary.
Below is the narrative from The Protoevangelium of James that describes exactly what happened when she was entrusted to the care of the Temple.
And the child was two years old, and Joachim said: Let us take her up to the temple of the Lord, that we may pay the vow that we have vowed, lest perchance the Lord send to us, and our offering be not received. And Anna said: Let us wait for the third year, in order that the child may not seek for father or mother. And Joachim said: So let us wait. And the child was three years old, and Joachim said: Invite the daughters of the Hebrews that are undefiled, and let them take each a lamp, and let them stand with the lamps burning, that the child may not turn back, and her heart be captivated from the temple of the Lord. And they did so until they went up into the temple of the Lord. And the priest received her, and kissed her, and blessed her, saying: The Lord has magnified your name in all generations. In you, on the last of the days, the Lord will manifest His redemption to the sons of Israel. And he set her down upon the third step of the altar, and the Lord God sent grace upon her; and she danced with her feet, and all the house of Israel loved her.
And her parents went down marvelling, and praising the Lord God, because the child had not turned back. And Mary was in the temple of the Lord as if she were a dove that dwelt there, and she received food from the hand of an angel.