This is the approved revision of this page, as well as being the most recent.
When to say it
During the winter one must say VeTen Tal UMatar Lebracha in Birkat HaShanim (Brachenu / Barech Aleinu). For this halacha the beginning of the winter is considered in Israel from the seventh of Cheshvan  and in the diaspora from the night of December 4th (and December 5th the year before a civil leap year, such as Thursday Dec 5th 2019). The end of the winter is Mincha of Erev Pesach and after that we stop saying VeTen Tal UMatar Lebracha in Birkat HaShanim. 
Outside Israel one isn't supposed to begin requesting rain until December 4th but if one did add it between the 7th of Chesvan and December 4th one should repeat Shmoneh Esrei with a stipulation that it should be a voluntary prayer. 
If one made a mistake during the winter
If one forgot to say VeTen Tal UMatar in Barech Alenu,
if one remembers before saying Baruch Atta Hashem at the end of the bracha, one should go back to the VeTen Tal Umatar and continue from there. 
if one remembers after saying Hashem's name in Barech Alenu, one should finish the bracha Mivarech HaShanim and not conclude with Lamdeni Chukecha. 
if one remembers after saying the bracha of Mevarech HaShanim, one shouldn't say VeTen Tal UMatar Libracha right there unless one is likely to forget to say it in Shama Kolenu in which case one should say it right after Mevarech HaShanim. 
if one remembers during Shema Kolenu, one should say it before the words Ki Atta Shomea 
if one remembers after saying Hashem's name of Shomea Tefillah, one should say Lamdeni Chukecha and return to Veten Tal prior to Ki Atta. 
If one remembered after Shoma Tefillah before Retzeh one may say VeTen Tal UMatar Libracha right there. 
if one remembered after beginning Retzay prior to saying Yeheyu LeRatzon after Elokay Netsor one should return to Brach Alaynu. 
If one is unsure whether one said VeTen Tal Umatar or not, if it's within 30 days, we assume one didn't say VeTen tal and so one has to repeat, however, after 30 days, one doesn't repeat. 
If one said the line "VeEt Kol Minei Tevuata Litova VeTen Tal UMatar Livbracha" 90 times one is assumed to have said VeTen Tal if one is unsure whether one said it or not. Some say that one should say continue "Al Peni HaAdama". Some say one should repeat the line 101 times, but after the fact 90 time is sufficient. 
Some say it's not proper to say this line 90 times because it puts oneself into a dispute, however, if one regularly is unsure whether one say Veten tal or not, one should say this line 90 times. 
If one is sure that one had in mind to say the addition or change to Shmoneh Esrei before starting Shmoneh Esrei but isn't certain that one remembered during Shmoneh Esrei, if after completing Shmoneh Esrei (or before) one becomes uncertain, one must repeat. However, if one only becomes uncertain a while after Shmoneh Esrei (after starting other prayers), one doesn't have to repeat. 
However, if a person knows that he losses his thoughts in Shmoneh Esrei and could forget to say it even if one remembered a moment earlier, some authorities hold one should always return (in cases of doubt) unless one is nearly certain that one said it. 
If one made a mistake during the summer
In the summer if one mistakenly said VeTen Tal UMatar Lebracha and one remembered before finishing his shemoneh esrei, he should go back to the beginning of Birkat HaShanim and start over from there. If one finished Shmoneh Esrei then one must repeat Shmoneh Esrei. 
Someone visiting Israel
A person who lives outside Israel who is visiting Israel after the 7th of Cheshvan before December 4th, according to Sephardim, he should say Barech Aleinu (not Barchenu) while he is in Israel. However, according to Ashkenazim, many opinions hold that if one will be in Israel during that entire period (from the 7th of Cheshvan until December 4th) one should say Ten Tal in Birkat HaShanim, however, if one would not be there for that amount of time one should say it in Shomea Tefillah. 
If a visitor from outside Israel (who will be there from 7th of Cheshvan until Dec 4th) forgets to say Ten Tal in Birkat HaShanim between the 7th of Cheshvan and Dec 4th, one should repeat Shmoneh Esrei. 
↑Sh"t Yechave Daat 1:73, Tur and Shulchan Aruch 117:1. The logic is based on a Mishna in Masechet Taanit 10a which says that since people were coming to Yerushalayim for Aliya Laregel, we wanted to give two weeks after Sukkot for them to return home before praying for rain so that they don't get rained on during their travels.
↑S”A 117:1, Artscroll Siddur (Nachlat Shimon p.104) writes that we begin to say VeTen Tal on the night of December 4th except if that year precedes a leap year. Halacha Brurah 117:5 writes that in a leap year (on a Hebrew calendar, December and February would be in the same year) we begin saying VeTen Tal on the night of December 5th.
Briefly, the winter Equinox (formally, Southward Equinox) is on September 23rd, however, due to the discrepancy between the Julian calendar and Shmuel's calendar, the equinox is assumed to be on September 21st. For an explanation of this point, see an article by Rabbi Shamah.
Shulchan Aruch 117:1 writes that outside Israel we begin saying VeTen Tal on the night of the 60th day from the equinox. To account for the difference between the Julian calendar and our commonly used civil calendar (Gregorian calendar), we have to review a bit of history. In 1582 the Gregorian calendar was pushed forward 10 days and skips one day every century on the century, except for years divisible by 400. That is, in 1600, the Gregorian calendar was 10 days ahead of the Julian calendar. By 1700, the Gregorian calendar was 11 days ahead. Continuing in this way, we see that by 2000 the Gregorian calendar was 13 days ahead of the Julian calendar. Since 2000 is divisible by 400 there was no leap year and the Gregorian calendar remains 13 days ahead of the Julian calendar until 2100. For more information about this calculation see the Wikipedia page on Gregorian calendar.
Counting 60 days from September 21st results in November 21st. Counting 13 from then to account for the difference between the Julian and Gregorian calendar, we arrive at the night of December 4th. See this shiur by Rabbi Sokolow for more sources on this topic.
↑ Mishna Brurah 117:15 rules that it's better not to say Veten Tal right after Mevarech HaShanim since one can still say it in Shema Kolenu. However, Sh"t Or Letzion 2:7:32 writes that if one is likely to forget to say in Shema Kolenu, one should say Veten Tal right after Mevarech HaShanim. Orach Neeman 117:11, Sh"t Teshuvot VeHanhangot 2:58, and Piskei Teshuvot 117:6 agree.
S”A 117:1 writes that during the winter we pray for rain by inserting the words “VeTen Tal UMatar Livracha” in Birkat HaShanim. If one forgot to say “VeTen Tal UMatar Livracha” and remembers after concluding the bracha of Mivarech HaShanim before beginning the next bracha, the Ravyah (cited by Rosh Tanit 1:1) writes that one should insert the words “VeTen Tal UMatar Levracha” right there. He reasons that this is similar to inserting the bracha of Mekadesh HaShabbat in Birkat HaMazon if one forgot Retseh and remembers right after Boneh Yerushalayim. In both cases, one makes up for a missed insertion immediately after the bracha in which it should have been said. On the other hand, the Rabbenu Yonah (cited by the Rosh Brachot 4:17) infers from the gemara that immediately upon finishing a bracha without the correct insertion one must return to the beginning of the mistaken bracha.
The Tur and Shulchan Aruch 114:6 and a number of achronim (Bach s.v. Katav HaAvi Ezri, Magen Avraham 114:8) hold like the Ravyah. The Beiur Halacha 114 s.v. Bli Chatimah, however, finds difficulty with the Ravyah and cites some rishonim and achronim who hold like the Rabbenu Yonah. These rishonim and achronim include the Rabbenu Yehuda HaChasid, Hagahot HaSmak, Maharshal (cited by Bach), Gra, and Kitzur Shulchan Aruch. In our case, the Beiur Halacha rules that one should avoid this question altogether by waiting until Shomea Tefillah to insert “VeTen Tal UMatar Levracha”. The Or Letzion 2:7:32 mitigates this by saying that if one is afraid of forgetting to insert it in Shomea Tefillah one may insert those words before starting the next bracha. The Yalkut Yosef 117:6, however, simply rules in accordance with Shulchan Aruch that one should insert "VeTen Tal UMatar Livracha" before beginning the next bracha.
↑ Shulchan Aruch 114:8 regarding Mashiv HaRuach. Mishna Brurah 114:37 writes that regarding VeTen Tal there's not 90 davenings in 30 days (because of Shabbat and Yom Tov), there's a dispute whether 30 days is sufficient and concludes that we hold leniently that after 30 days it's assumed that one says it correctly. Halacha Brurah 114:14 disagrees and says that if one is unsure whether or not he said it during this period that is after 30 days, but 90 prayers haven't been recited, he should repeat the shemoneh esrei but to avoid any concern, should stipulate that if he is obligated to repeat then he is repeating but if not it should be considered a voluntary prayer.
↑ Shulchan Aruch 114:9 regarding Mashiv HaRuach writes that if one says the line in davening 90 times one is assumed to say it correctly. Mishna Brurah 114:40 writes that one should say from VeEt Kol Minei but leaves out Al Peni HaAdama, while Piskei Teshuvot 114:15 quotes Shulchan Shlomo who says to say it. Mishna Brurah 114:41 quotes the Chatom Sofer who says that the line should be said 101 times but the Mishna brurah concludes the after the fact one wouldn't repeat Shmoneh Esrei against the simple ruling of Shulchan Aruch.
↑Even though the Beiur Halacha 114 D"h Im Bayom, quotes the Gra and Taz who disagree with Shulchan Aruch here and hold that one always needs 30 days, the Beiur Halacha concludes that almost all achronim hold like Shulchan Aruch. Nonetheless, Rabbi Shlomo Zalman Auerbach in Halichot Shlomo (Tefillah 8:26) writes that it's not proper to do this advise because it puts oneself into a dispute. For someone who commonly is unsure, the Piskei Teshuvot 114:15 quotes the Birchat HaBayit, who says that for someone who commonly is unsure who should follow this advise and has the Shulchan Aruch to rely on.
↑ Regarding an American in Israel, the Pri Chadash and Pri Megadim hold that if one plans on going back to America within a year, one should start Ten Tal from when they start in America. However, if one plans on going back to America after a year, one should start Ten Tal when Israel begins asking for rain. On the other hand, the Birkei Yosef holds that one should always make the Bracha according to the place one is presently in. The Mishna Brurah 117:5 brings both opinions and doesn’t rule on this issue but implies that he sides with the Pri Megadim.
While an American is in Israel, many poskim hold like the Birkei Yosef that one should say the Ten Tal in Birkat HaShanim. These poskim include: Sh”t Yacheve Daat 1:73 (also paskened in Yalkut Yosef (Tefillah vol 2 pg 99) and Halacha Brurah 117:9), Sh”t Minchat Yitzchak 10:9, Sh”t Bear Moshe (vol 7 pg 194, 200), Sh”t Mishneh halachot 5:28, and Piskei Teshuvot 117:3. [See also Sh”t Divrei Yetsiv, Sh”t Besel Chachma 1:62, Mara DeShmata #34, Sh”t Kaneh Bossem 1:10, Sh”t Birur Halacha 117].
On the other hand, some hold that in order to say Ten Tal UMatar in Birkat HaShanim one has to be in Israel for the season of rain from 7 Cheshvan until dec 4 when they start asking for rain in America, however, if one will not be there for that period of time one should only say it in Shomea Tefillah. These opinions include: Sh”t Bear Moshe (vol 7 pg 202 in name of his brother), Sh”t Teshuvot VeHanhagot 2:55, Halichot Shlomo (Tefillah 8:21), Ishei Yisrael 23:37, Yom Tov Sheni Kehilchato (10:7) quoting Rav Shlomo Zalman and Rav Elyashiv, and Shegiyot Mi Yavin 13:40 in name of Rav Elyashiv.
Thirdly, some hold that only if one will be in Israel from 7 Chevan until Pesach when we stop asking for rain, then one should say Ten Tal in Birkat HaShanim, otherwise one should say it in Shomea Tefillah. This is also the opinion of Sh”t Mishna Shlomo, Sh”t Vayeshev Moshe 1:102 (quoted by Piskei Teshuvot 177:3).
Lastly, some write that an American in Israel should in general say it in Shomea Tefillah. This includes the Rav Pinchas Sheinburg (A Teshuva in back of Sefer Chovot Yair) in name of the Steipler (also brought in Sh”t Rivivot Efraim 6:433(3)) and Tefillah KeHilchata 12:48 in name of Rav Elyashiv (the Shigyot Mi Yavin asks on this). [Seemingly, this opinion only holds this when an American is there for less than a year.]
↑ Sh”t Rivivot Efraim 6:45(2) quoting Yashiv Moshe in name of Rav Elyashiv writes that one should repeat Shmoneh Esrei under all circumstances. However, Rav Shlomo Zalman in Halichot Shlomo (Tefillah 8:21 in the note), sh”t Teshuvot Vehanhagot 2:55 (dini ben chul#1), Yom Tov Sheni Kehilchato 10:7 in name of Rav Shlomo Zalman, and Shigiyot Mi Yavin (13:40) rule that one should only repeat Shmoneh Esrei if one will be there from 7th of Cheshvan until Dec 4th. However, if one will not be there from Cheshvan 7 until Dec 4th, one doesn’t need to repeat Shmoneh Esrei. So writes all the above sources, and Yom Tov Sheni Kehilchato 10:7 quotes Rav Elyashiv who adds that it’s proper to repeat Shmoneh Esrei on condition that it’s a voluntary Tefillah if one isn’t obligated.