א״ר יוסי בר׳ חנינא משום ראב״י המתפלל צריך שיכוין את רגליו שנאמר ורגליהם רגל ישרה
This is brought in the Rambam Tefila 5:4 (part of תיקון הגוף for תפילה along with how to hold ones hands and where ones eyes should be, which may be understood as how to stand in front of the King) and the Smag Asei 19 (good way to remember it is that we have 19 berachos in our "shmonah esrei") and Shulchan Aruch OC 95:1, and see MB 1 that one fulfills his obligation post facto if his legs were not aligned.
As far as the exact alignment of one's feet: see Tur OC 95 who brings a dispute in the Yerushalmi (Berachos 1:1) whether they should be aligned like the מלאכים or staggered a little like the Kohanim ascending the מזבח, and see Beis Yosef who discusses the opinion of the Bavli in this matter based on Rabeinu Yonah. In the ספר הקצר (aka the Shulchan Aruch) he paskens like the opinion that we are to stand like the מלאכים.