The prayer for rain is two brief sentences inserted into the Amida prayer, said three times daily. It's not actually a prayer for rain in terms of demanding of God what he's not about to give. On the contrary, it is recited only during the rainy season, so it's more a request that the rainy season will be successful: gishmei b'racha, rains that bring blessings, i.e not to hard nor too weak; neither draught nor floods.
The rainy season falls between October and April, and that's when the prayer for rain is said. Jews living in Bangkok, where - so I'm told - it rains 365 days a year, pray for rain between October and April. The Jews who spent some 2,000 years lving in Egypt, where it more or less never rains, prayed for rain every year between October and April, until they were ethnically cleansed out after the creation Israel. The reason for all this is quite simple: Jews pray for rain in their homeland, here, and this is the way they've always done it. No matter where they lived, nor for how long, they prayed for rain at home.
With a complication. The rainy season is expected to begin right after Sukkot, one of the three holidays when hundreds of thousands of Jews used to come up to Jerusalem, and it end at the beginning of Pessach (Passover), another one of the pilgrimage holidays. And back in the era when the rules were being drawn up, the Pilgrims traveled by foot and donkey. So the prayer is divided. The first sentence - praise for "He Who causes wind and rain" is recited from Sukkot until Pessach. But the second, more explicit "Give dew and rain as a blessing", is recited starting three weeks after Sukkot, and stopped three weeks before Pessach - so that the rain not harm the Pilgrims.
Today, the 7th of Heshvan, the three weeks are up, and from now on we're serious about wanting rain, until three weeks before Pessach.
The first rain of the season, by the way, was the day before yesterday.