In Chapter 7 Mary turns two. Joachim says that it is time to take Mary to the Temple so that they can fulfil their vows so that the Lord doesn't find them to be forsworn and their offerings unacceptable. Anna says that they need to wait until Mary is three, otherwise she might become homesick and cry for her mother and father all the time.
I'm not sure what the difference is between a child of two and a child of three being taken off to live with strangers and their longing for their parents, but there you go. It's decided and they keep Mary with them until she turns three.
At her third birthday Joachim calls for the 'undefiled daughters of the Hebrews' and they each take a lamp, lighting it so that 'the child will not turn back and her heart be captured from the temple of the Lord.' They escort the child to the temple and she is handed over to the priest.
He welcomes her, "The Lord has magnified your name to all generations of the earth. By you, unto the last of days, the Lord God will reveal redemption to the children of Israel." The priest sets her on the third step of the altar and the Lord pours out His grace upon her. This is the part where she dances with her feet sitting there. So very cute to imagine. :)
The notes for this are about the odd idea of turning a child over to priests to raise. We know that Hannah did it with Samuel, but did she come up with it or was it an established practice? If Hannah came up with it there must certainly have been women after her who made the same vow and some of those children must have been born girls. We don't really know, but there is at least one piece of evidence of a woman living in the temple. The Prophetess Anna is said to have been living in the temple for decades, and 'she did not depart from the temple, worshipping with fasting and prayer night and day.' So while there were some places in the temple that Mary would have been forbidden by virtue of her femininity it's theoretically possible that she really was taken into the temple - perhaps in the court of the women - in a place designed for female children who had been dedicated to the temple.