Joachim and Anne were, according to ancient tradition, the parents of the Blessed Virgin Mary. All our information concerning them comes from apocryphal literature, mostl pseudonymous gospels — the Gospel of the Nativity of Mary, the Gospel of Pseudo-Matthew, and the Protoevangelium of James. Though the Protoevangelium is very ancient — going back to about A.D. 150 — its contents are fanciful, and the Fathers of the Church were divided on the question of its value. Some thought the apocryphal gospels encouraged piety. Others deemed them dangerous. In some parts of the East the Protoevangelium was read publicly on Marian feasts. Truth or fantasy, here’s the story in summary form, from the Catholic Encyclopedia:
In Nazareth there lived a rich and pious couple, Joachim and Hannah. They were childless. When on a feast day Joachim presented himself to offer sacrifice in the temple, he was repulsed by a certain Ruben, under the pretext that men without offspring were unworthy to be admitted. Whereupon Joachim, bowed down with grief, did not return home, but went into the mountains to make his plaint to God in solitude. Also Hannah, having learned the reason of the prolonged absence of her husband, cried to the Lord to take away from her the curse of sterility, promising to dedicate her child to the service of God. Their prayers were heard; an angel came to Hannah and said: “Hannah, the Lord has looked upon thy tears; thou shalt conceive and give birth and the fruit of thy womb shall be blessed by all the world”. The angel made the same promise to Joachim, who returned to his wife. Hannah gave birth to a daughter whom she called Miriam (Mary).
In the East the cult of St. Anne can be traced to the fourth century. St. Ephiphanius records that heretics of that time taught, erroneously, that St. Anne conceived without the action of man. The emperor Justinian I (d. 565) had a church dedicated to her. Some parts of the Greek Office of St. Anne are ascribed to Anatolius of Byzantium, who flourished in the fifth century.