The time for reciting maariv (the evening prayers) extends throughout the night. Nevertheless, the sages were concerned that people would delay the recitation of the biblically mandated nighttime Shema – which is recited as part of the maariv – until the last moment, and risk forgetting to say it altogether. They therefore instituted that maariv should be prayed before halachic midnight.1
If this time has passed, one can still pray the complete maariv until alot hashachar (dawn).
If due to unavoidable circumstances alot hashachar has arrived and you have not yet prayed maariv, you may still do so until sunrise. However, omit the blessing beginning with the words "Hashkiveinu avinu" ("Our Father, lie us down..."). In this blessing we ask G‑d to give us a peaceful night, and it would be somewhat silly to request a good night when the day is just beginning!
For the earliest time you can pray maariv, see More on Plag Hamincha.
Click here to see the halachic times for nightfall, midnight, dawn and sunrise in your area.
Rabbi Eliezer Posner
Can I pray Maariv any time before the Halachic midnight? In Brazil as I am new in Brazil
Yes, the rule is the same for Brazil.
Please also bear in mind that in the event one did not make it before Halachic midnight, one still prays Maariv until the rising of the Morningstar (Alos haShachar).
If one misses this as well, one does not pray Maariv, but one still recites the Sh'ma until Dawn (Neitz haChama).
The two links in the article above will help you understand the earliest you can pray (More on Plag Hamincha.) and what time that is on the clock based on your location (Click here to see the halachic times...).