The story is related in some of the apocryphal gospels, and is extensively recorded in The Mystical City of God of the Ven. Maria de Jesus de Agreda (book II ch 1). Here are some excerpts (#421-422):
421. The three years time decreed by the Lord having been completed, Joachim and Anne set out from Nazareth, accompanied by a few of their kindred and bringing with them the true living Ark of the covenant, the most holy Mary, borne on the arms of her mother in order to be deposited in the holy temple of Jerusalem. The beautiful Child, by her fervent and loving aspirations, hastened after the ointments of her Beloved, seeking in the temple Him, whom She bore in her heart...
Thus they pursued their journey from Nazareth to the holy city of Jerusalem, and also the parents of the holy child Mary felt in their hearts great joy and consolation of spirit.
422. They arrived at the holy temple, and the blessed Anne on entering took her Daughter and Mistress by the hand, accompanied and assisted by saint Joachim. All three offered a devout and fervent prayer to the Lord; the parents offering to God their Daughter, and the most holy Child, in profound humility, adoration and worship, offering up Herself...
Having offered their prayers, they rose and betook themselves to the priest. The parents consigned their Child into his hands and he gave them his blessing. Together they conducted Her to the portion of the temple buildings, where many young girls lived to be brought up in retirement and in virtuous habits, until old enough to assume the state of matrimony. It was a place of retirement especially selected for the first-born daughters of the royal tribe of Juda and the sacerdotal tribe of Levi.
On this special Marian feast, the Church celebrates also her contemplatives, the lives consecrated to God in a life of prayer. Thus this is also called "Pro Orantibus Day" -the Day For Those Who Pray-
Pope Francis marked the ocassion by visiting the contemplative monastery of the Camaldolese nuns in Rome, and prayed with them Vespers as well as a time of adoration to the Blessed Sacrament.
Here is a short video of the visit:
Some references for the Pro Orantibus Day: http://www.cloisteredlife.com/pro-orantibus-day/