St. Thomas Aquinas on Prayer: Should prayer last a long time? in Summa Theologiae IIa-IIae q.83 a.14 (pdf here) commented on both passages as follows:
On Mt 6:7-8 in response to Objection 1
It would seem that prayer should not be continual. It is written (Matthew 6:7): "When you are praying, speak not much." Now one who prays a long time needs to speak much, especially if his be vocal prayer. Therefore prayer should not last a long time.
he quoted Augustine from ad Probam. Ep. cxxx (Letter 130):
"to pray with many words is not the same as to pray long; to speak long is one thing, to be devout long is another. For it is written that our Lord passed the whole night in prayer, and that He 'prayed the longer' in order to set us an example."
Further on he says:
"When praying say little, yet pray much so long as your attention is fervent. For to say much in prayer is to discuss your need in too many words: whereas to pray much is to knock at the door of Him we pray, by the continuous and devout clamor of the heart. Indeed this business is frequently done with groans rather than with words, with tears rather than with speech.
On Luke 18:1 in the sed contra (On the contrary):
It would seem that we ought to pray continually. For our Lord said (Luke 18:1): "We ought always to pray, and not to faint": and it is written (1 Thessalonians 5:17): "Pray without ceasing."
And in the respondeo dicendum quod conversatio (I answer that):
We may speak about prayer in two ways: first, by considering it in itself; secondly, by considering it in its cause. The cause of prayer is the desire of charity, from which prayer ought to arise: and this desire ought to be in us continually, either actually or virtually, for the virtue of this desire remains in whatever we do out of charity; and we ought to "do all things to the glory of God" (1 Corinthians 10:31). From this point of view prayer ought to be continual: wherefore Augustine says (ad Probam, Ep. cxxx, 9): "Faith, hope and charity are by themselves a prayer of continual longing." But prayer, considered in itself, cannot be continual, because we have to be busy about other works, and, as Augustine says (ad Probam. Ep. cxxx, 9), "we pray to God with our lips at certain intervals and seasons, in order to admonish ourselves by means of such like signs, to take note of the amount of our progress in that desire, and to arouse ourselves more eagerly to an increase thereof." Now the quantity of a thing should be commensurate with its end, for instance the quantity of the dose should be commensurate with health. And so it is becoming that prayer should last long enough to arouse the fervor of the interior desire: and when it exceeds this measure, so that it cannot be continued any longer without causing weariness, it should be discontinued. Wherefore Augustine says (ad Probam. Ep. cxxx): "It is said that the brethren in Egypt make frequent but very short prayers, rapid ejaculations, as it were, lest that vigilant and erect attention which is so necessary in prayer slacken and languish, through the strain being prolonged. By so doing they make it sufficiently clear not only that this attention must not be forced if we are unable to keep it up, but also that if we are able to continue, it should not be broken off too soon." And just as we must judge of this in private prayers by considering the attention of the person praying, so too, in public prayers we must judge of it by considering the devotion of the people.
Commenting on the sed contra:
One may pray continually, either through having a continual desire, as stated above; or through praying at certain fixed times, though interruptedly; or by reason of the effect, whether in the person who prays—because he remains more devout even after praying, or in some other person—as when by his kindness a man incites another to pray for him, even after he himself has ceased praying.
CONCLUSION: Aquinas, and most likely the Catholic church agrees with him, believes that taking Luke 18:1-5 and Matthew 6:7-8 together, the motivation is on continual desire of charity in ourselves and implemented to be "commensurate with its end" (for example, should take into account health) and "should last long enough to arouse the fervor of the interior desire". Interpreting Matthew 6:7-8, he said the type of prayer should be short enough (not redundant with too many words) but frequent and devout.
I believe this view is consistent with Christian belief in God's providence where God already know what we are going to ask. The purpose of prayer then is to change us, not to change God. God would then be pleased, not pestered, when this frequent prayer produces increased charity in ourselves, consistent with his command to love our neighbors as we love ourselves.