Do Catholics believe that Jesus' time in the wilderness was meant as an allegory? Then Jesus was led by the Spirit into the wilderness to be tempted by the devil. After fasting forty days and forty nights, he was hungry. The tempter came to him and said, “If you are the Son of God, tell these stones to become bread.” Matthew 4:1-3


Do Catholics believe that Jesus' time in the wilderness was meant as an allegory? Or did this story actually happen?

And if it happened, did the Apostles witness it? Or did Jesus retell this story to Matthew, who then later retold it in his Gospel?
Catholics believe in the four senses of Scripture and that all Scripture should be interpreted, firstly by the literal sense (not literalistic, as in every must be taken as having literally happened).  Allegory is only one of the spiritual senses of Scripture.  See the reference to the Catechism beginning in paragraph 101.  You may want to continue reading in the catechism to get a more developed idea of the four senses of Scripture.


  116 The literal sense is the meaning conveyed by the words of Scripture and discovered by exegesis, following the rules of sound interpretation: “All other senses of Sacred Scripture are based on the literal.” [St. Thomas Aquinas, S Th I, 1, 10, ad I]
  117 The spiritual sense. Thanks to the unity of God's plan, not only the text of Scripture but also the realities and events about which it speaks can be signs. 1. the allegorical sense. We can acquire a more profound understanding of events by recognizing their significance in Christ; thus the crossing of the Red Sea is a sign or type of Christ's victory and also of Christian Baptism. [Cf. I Cor 10:2] 2. the moral sense. the events reported in Scripture ought to lead us to act justly. As St. Paul says, they were written “for our instruction”. [I Cor 10:11; cf. Heb 3:1 - 4:11] 3. the anagogical sense (Greek: anagoge, “leading”). We can view realities and events in terms of their eternal significance, leading us toward our true homeland: thus the Church on earth is a sign of the heavenly Jerusalem. [Cf. Rev 21:1 - 22:5]