The ideal location to pray at, if a place can be found that is quiet and offers relatively privacy, is in a home (Matthew 6:6). The early church of God often communed with the Father either in the homes of brethren or in rooms of various sizes (Acts 1:13 - 14, 24 - 25, 12:5, 15, see also our article on home fellowships). That said, the Bible records an amazing variety of places where communicating with the Eternal took place.
Jesus was known to pray on the side of a mountain (Matthew 14:23, Mark 6:46, Luke 6:12, 9:28). One time Peter made his supplications known on a friend's roof (Acts 10:9). Petitions have been offered by the side of a river (Acts 16:13), in wilderness areas (Luke 5:16), and in a beautiful garden (Matthew 26:36, Mark 14:32, Luke 22:45). The fighting men of three Israelite tribes cried out to the Eternal and were heard when they were on a battlefield (1Chronicles 5:18 - 20).
Because of their arrest in Philippi, the Apostle Paul and Silas had to pray and sing hymns while in prison (Acts 16:24 - 25). Paul, when the ship taking him to Palestine stopped in the port of Miletus, met near the boat with Ephesian church elders and together sought God's will (Acts 20:17 - 38). During his fourth missionary journey, he found himself on a ship battling fierce winds and violent storms on the Mediterranean Sea. His willingness to pray, while being lost at sea, saved not only himself but also 275 others (Acts 27:14 - 27).
Petitions to God were also frequently made in places such as Jerusalem's temple (Luke 18:10, Acts 3:1). Jesus not only called it a "house of prayer" for all people but also threw out those who profaned this holy purpose (Mark 11:17, Matthew 21:13, Luke 19:46). In the future, all nations will gather in Jerusalem to call upon the Lord (Isaiah 56:4 - 8, Zechariah 8:20 - 22). Prayers have been made by those either visiting foreign lands or while they were captive in them (Genesis 20:7, 32:9 - 10, 2Chronicles 6:37 - 38). The prophet Jonah cried out for help from the belly of a great fish (Jonah 2:1).
The best place to pray, based on Christ's Sermon on the Mount, is in a private location in our homes or in some other quiet location (Daniel 6:10, Matthew 6:6, Acts 10:9, etc.). Jesus himself frequently communed with his Father while alone (Mark 6:46, Luke 5:16, 6:12, Matthew 14:23). The Bible records many cases, however, which deviate from this common pattern. For example, there were times when Christ communicated to the Father along with others (Luke 9:28 - 29).
Many people sought God, both individually and collectively, when celebrating the annual Feast days in Jerusalem (2Chronicles 30). Elijah publically requested that the Eternal consume his sacrifice on Mount Carmel, which sealed the fate of pagan priests who were leading the people astray (1Kings 18). The twelve disciples heard Christ pray for them, on the night he was betrayed, as they walked to Gethsemane (John 17:1 - 26).
It should be noted that Christ roundly criticized Jewish religious leaders (e.g. Pharisees, scribes, etc.) not because they prayed in public places but because of their self-centered attitude for doing so (Matthew 6:5 - 6). The early New Testament church frequently met in groups, both during the week and on the Bible Sabbath, to pray together (Acts 1:13 - 14, 24 - 25, 2:46, 12:1 - 5, 1Corinthians 14:14 - 16, etc.). James admonishes the church to always have a group of mature Christians ready to visit and beseech the Eternal for the healing of those who are sick (James 5:14 - 15).
It is always acceptable, whether in the privacy of a home or in some public place, to make our petitions known to God. There are also times, however, when we should pray with others (e.g. during worship services, bible studies, anointing the sick, in times of crisis or personal need, etc.) so that our collective voices reach the ears of the Eternal. Ultimately, the best place to pray is anywhere!