One must remember on Purim to add the recitation of Al Ha'nissim in both Birkat Ha'mazon and Shemona Esrei. In Birkat Ha'mazon, one inserts Al Ha'nissim in the paragraph of "Nodeh" (before "Ve'al Ha'kol"), and in Shemona Esrei it is recited in the "Modim" section (before "Ve'al Kulam").
One who forgot to include Al Ha'nissim in either Birkat Ha'mazon or Shemona Esrei need not repeat the given recitation. The Maharshal (Rabbi Shlomo Luria, 1510-1573) and the Shela (Rabbi Yeshaya Horowitz, 1565-1630) were of the opinion that one is obligated to eat bread with the Purim meal, and they therefore held that one who forgot to include Al Ha'nissim in Birkat Ha'mazon after his first meal on Purim day must, in fact, repeat Birkat Ha'mazon. (A basic Halachic principle dictates that whenever Halacha obligates eating a meal with bread, one must repeat Birkat Ha'mazon if he forgot to include the appropriate addition for the given occasion.) The vast majority of authorities, however, including the Shulchan Aruch, Mishna Berura, Kaf Ha'chayim and Chida, maintain that bread is not, strictly speaking, obligatory at the Purim meal – even though it should preferably be included, and this has indeed become the custom – and therefore even after this meal one need not repeat Birkat Ha'mazon if he forgot to include Al Ha'nissim.
Nevertheless, if the individual remembered Al Ha'nissim before reciting "Baruch Ata Hashem" of the given Beracha ("Al Ha'aretz Ve'al Ha'mazon" in Birkat Ha'mazon, and "Ha'tov Shimcha…" in Shemona Esrei), he should go back to recite Al Ha'nissim. If he remembered only after he recited the words "Baruch Ata Hashem," but before proceeding with the Beracha, then according to some authorities he should conclude, "Lamedeni Chukecha" and go back to recite Al Ha'nissim. However, Halacha does not follow this view; once the individual has recited "Baruch Ata Hashem," he simply continues with the Beracha as usual.
In such a case, when one did not remember Al Ha'nissim in time to include it in its proper place, he still has the opportunity to add it towards the end of Birkat Ha'mazon or Shemona Esrei. In Birkat Ha'mazon, he can insert Al Ha'nissim in the "Ha'rachaman" section, by reciting, "Ha'rachaman Hu Ya'aseh Nissim… Bi'mei Mordechai Ve'Ester… " In Shemona Esrei, one can insert Al Ha'nissim just before reciting "Oseh Shalom Bi'mromav."
If one completed the entire Birkat Ha'mazon or Shemona Esrei without reciting Al Ha'nissim, he does not repeat Birkat Ha'mazon or Shemona Esrei at all.