Until recently, you knew who the mother was because it's the lady out of whom this baby came. Hence the established practice for using the mother's name when praying for someone sick.
There are many Talmudic precedents that some apply to this -- Rabbi Yissochar Frand has a tape on this that simply concludes "we're left in doubt." Do we compare it to grain that had partially grown, and then was replanted? To a pregnant woman who converts, and thus the fetus is converted in utero? Do we prove from the Dinah midrash that the birth-mother is halachically the mother [as the Torah implies that Leah is the mother], or do we follow the explanation found in one commentary that Shimon was allowed to marry Dinah precisely because they had different egg mothers? (It's debatable how to interpret the Dinah story.)
As for practical rulings: Rabbi Kenneth Brander has a yutorah mp3 on this: most 20th-century American poskim felt that the birth mother is halachically the mother, with Rabbi Aaron Soloveichik zt'l insisting that the egg is viewed by halacha as "no different than some synthetic product made in Japan."
Many Israeli poskim -- plus Rabbis Heinemann and Hopfer in Baltimore -- believe that halacha follows the egg mother.
In recent years, some American poskim are starting to reconsider, causing a great deal of consternation. Rabbi Ezra Schwartz has a lecture to rabbinic students at YU where he says: "when I was sitting in your chair, we were clearly told that the birth mother is the halachic mother. Now ... we're not so sure. And to make it worse, what happens if a Jewish couple in Chicago obtained a non-Jewish donor egg 30 years ago and were given the psak of R' Aaron Soloveichik that the baby did not need conversion because the host mother is Jewish ... now that baby is 30 years old and dating and suddenly today's American rabbis aren't so sure."