The dogma of 1854 in the Apostolic Constitution Ineffabilis Deus by Pope Pius IX states the belief:
We declare, pronounce, and define that the doctrine which holds that the most Blessed Virgin Mary, in the first instance of her conception, by a singular grace and privilege granted by Almighty God, in view of the merits of Jesus Christ, the Savior of the human race, was preserved free from all stain of original sin, is a doctrine revealed by God and therefore to be believed firmly and constantly by all the faithful.
Therefore, the moment you are looking for is just before the conception of the Blessed Virgin, at the latest.
The fact that Scripture seems to look forward to the role of the Blessed Virgin as mother of Him who utterly defeats the snake, in Genesis 3:15, suggest rather strongly that God at least at that moment had chosen the way history would work out. It is hard to imagine that He didn’t know the details yet.
In this light I think it is important to realize that even though God works within time, He isn’t bound by time. Saint Augustine talks about this in detail: God is the creator of time, not subject to it. As God isn’t bound by time, His knowledge, His choices, are not bound by time either. So if we may believe that the Blessed Virgin was chosen before her conception, and God knew that the child of “a woman” would defeat the snake at the time of Adam and Eve, it seems logical to assume that Mary was chosen no later then at the moment of the fall of man, and probably from the beginning of creation, as far as “when” matters to God.