Prayers are messages that the gods may hear, and answer to. You can only pray at an altar or a temple. Altars can be built anywhere with the proper materials. Temples can only be built in established towns as a facility. Both allow you to make offerings of items, which increases the likelihood of your prayer being heard. Temples also allow you to offer money as an offering in addition to goods.