Prayer is necessary for salvation. It is a distinct precept of Christ in the Gospels. The precept imposes on us only what is really necessary as a means of salvation. Without prayer, we cannot resist temptation, nor obtain God’s grace, nor grow and persevere in it. This necessity is incumbent on all according to their different states in life, especially on those who by virtue of their office, of priesthood, for instance, or other special religious obligations, should in a special manner pray for their own welfare and for others. The obligation to pray is incumbent on us at all times. It is especially pressing when we are in great need of prayer, when without it we cannot overcome some obstacle or perform some obligation; when, to fulfill various obligations of charity, we should pray for others; and when it is specially implied in some obligation imposed by the Church, such as attendance at Mass, and the observance of Sundays and feast-days. This is true of vocal prayer, and as regards mental prayer, or meditation, this, too, is necessary so far as we may need to apply our mind to the study of Divine things in order to acquire a knowledge of the truths necessary for salvation.

In hearing our prayer God does not change His will or action in our regard, but simply puts into effect what He had eternally decreed in view of our prayer. This He may do directly without the intervention of any secondary cause as when He imparts to us some supernatural gift, such as actual grace, or indirectly, when He bestows some natural gift. 

Source: Catholic Encyclopedia

When you pray, do not be like the hypocrites, who love to stand and pray in the synagogues and on street corners so that others may see them. Amen, I say to you, they have received their reward. But when you pray, go to your inner room, close the door, and pray to your Father in secret. And your Father who sees in secret will repay you. In praying, do not babble like the pagans, who think that they will be heard because of their many words. Do not be like them. Your Father knows what you need before you ask him. (Matthew. 6:5-8)

Ask and it will be given to you; seek and you will find; knock and the door will be opened to you. (Matthew. 7:7)

Persevere in prayer, being watchful in it with thanksgiving. (Colossians. 4:2)

Rejoice in hope, endure in affliction, persevere in prayer. (Romans. 12:12)

The end of all things is at hand. Therefore, be serious and sober for prayers. (1 Peter. 4:7)

Then he told them a parable about the necessity for them to pray always without becoming weary… (Luke. 18:1)