The exact timeline hasn't been listed yet, but there are a few assumptions we can make.
- It has to be after the Pandorica events. (Melody is conceived in the TARDIS on their honeymoon).
- There has to be enough time for The Church (and Madame Kovarian) to find out about the pregnancy and make a plan. (Although it's most likely that Kovarian has time-travel capability on her own, "time" becomes a much more flexible requirement).
- The Doctor doesn't know about Amy's pregnancy until towards the end of Impossible Astronaut. Amy then tells the Doctor she was mistaken in Day of the Moon, three months later. At the end of that episode is the first time we see the "positive/negative" result.
That means that the absolute latest that the swap could be made is between Impossible Astronaut and Day of the Moon (while Amy's on the run). Plenty of opportunities for a swap to be made, and it's plausible that people out to get the Doctor would know about it by that point. It also explains why Amy thinks she's not pregnant (three months later and not showing is pretty convincing). It also matches up with the Doctor's comment about Amy being gone "since America".
The second window is pre-Impossible Astronaut (while Rory and Amy are hanging out at home between adventures). This is slightly less likely, as it's implied that Amy's only finding out about the pregnancy either during or just before this episode (remember, Rory doesn't know about it). This makes it more difficult to explain how The Church would know about it as well.