We are in Maseches Ta'anis, chapter 1, mishnah 2. The mishnah opens: "Ein sho'alin es hageshamim ela samuch ligshamim" - we do not request rain except close to the time when it is actually needed. The Gemara offers two explanations of this statement.
The two explanations in the Gemara:
It refers to the mention: This is not the request for rain, whose place is in the berachah of 'Shomea Tefillah' later in Shemoneh Esrei, but rather the mention of 'Mashiv haruach umorid hageshem', even though the mishnah used the language of asking. According to this, our mishnah follows the opinion of Rabbi Yehoshua in the previous mishnah, who holds that we begin mentioning 'Mashiv haruach' from Shemini Atzeres, the last day of the festival of Sukkos, because that time is close to the time when we want the rains to begin falling - as opposed to Rabbi Eliezer, who holds that the mention begins already from the start of Sukkos.
It refers to the request: It refers to the request in 'Shomea Tefillah', in which we actually ask for rain. The meaning of "close to the rains" will be explained in the next mishnah: even according to Rabbi Eliezer we do not ask for rain immediately, but only a certain amount of time after Sukkos, depending on where a person lives.
The mishnah continues: "Rabbi Yehudah omer: ha'over lifnei hateivah b'yom tov ha'acharon shel chag - ha'acharon mazkir, harishon eino mazkir. B'yom tov harishon shel Pesach - harishon mazkir, ha'acharon eino mazkir" - Rabbi Yehudah says: the one who leads the prayers on the last day of the festival of Sukkos - the last one mentions rain, the first one does not; on the first day of Pesach - the first one mentions rain, the last one does not.
On Shemini Atzeres: The last chazzan, who leads Mussaf, is the one who says 'Mashiv haruach umorid hageshem' - and this is our practice as well; while the first one, who leads Shacharis, does not mention it.
On the first day of Pesach: The first one, who leads Shacharis, still mentions 'Mashiv haruach'; while the last one, who leads Mussaf, does not. This is when we begin saying 'Morid hatal' - according to the custom of those who say 'Morid hatal' in place of 'Mashiv haruach'; those who do not follow that custom say nothing at all.
"Ad eimasai sho'alin es hageshamim" - until when do we ask for rain:
The mishnah discusses until when we say the request for rain, meaning the request in 'Shomea Tefillah'. On this point the Tanna'im disagree:
Rabbi Yehudah: "Ad sheya'avor haPesach" - until the festival of Pesach has ended.
Rabbi Meir: "Ad sheyeitzei Nissan" - we say it until the end of the month of Nissan, as the verse states: "Vayored lachem geshem moreh umalkosh barishon" - He brings down for you rain, the early rain and the late rain, in the first month - meaning that rain falls throughout the entire first month. From the verse it emerges that rainfall during all the days of Nissan is still a blessing.
The halachah: We rule that we stop saying the request in 'Shomea Tefillah' at the same time that we stop saying 'Mashiv haruach umorid hageshem', and the last time the request for rain is said is at Minchah on Erev Pesach, since it is not said on Yom Tov.