The writing of Scripture requires divine authorization.
Above all, you must understand that no prophecy of Scripture came
about by the prophet’s own interpretation of things. (2 Peter 1:20)
From the answer given by Jas3.1, it is clear that Jesus said many things that were not written down, so commissioning the writing of the Gospels could be among the things not written down. Let us assume that is NOT the case, since the Bible has had a huge impact on the world and such an important detail is one worthy of note.
Scripture says much about the ways of God, and much about how His Word enters into human history and is authorized and recorded. Perhaps the Old Testament can clarify this question?
First, when and how did the Bible start to be written down? We can't know for certain, but tradition holds that Job is the oldest book, and was likely committed to written form by Moses. Well, how is it that Job's words were recorded?
- Prayer
- The Holy Spirit
This was Job's prayer:
“Oh, that my words were recorded,
that they were written on a scroll, 24 that they were inscribed with an iron tool on lead,
or engraved in rock forever! 25 I know that my redeemer lives,
and that in the end he will stand on the earth. 26 And after my skin has been destroyed,
yet in my flesh I will see God; 27 I myself will see him
with my own eyes—I, and not another.
How my heart yearns within me!" (Job 19:23-27)
It says in the James 5:16 that the prayer of a righteous man availeth much, and prior to Jesus, Job was the world's most righteous man. Job prayed the Bible into existence!
Of course another speaker in Job, Elihu, had this to say:
For I am full of words,
and the spirit within me compels me;
19 inside I am like bottled-up wine,
like new wineskins ready to burst.
20 I must speak and find relief;
I must open my lips and reply. (Job 32:32)
Jesus later compared the Holy Spirit to new wine that needed a new wineskin. So prayer and the Holy Spirit are essential.
So we have a "pens up" moment, when the Bible started to be written. Of course in Revelation, there is a "pens down" moment, when John prays this, also by the Spirit:
18 I warn everyone who hears the words of the prophecy of this scroll:
If anyone adds anything to them, God will add to that person the
plagues described in this scroll. 19 And if anyone takes words away
from this scroll of prophecy, God will take away from that person any
share in the tree of life and in the Holy City, which are described in
this scroll. (Revelation 22:18-19)
(John may have applied this only to his prophecy, but God has a habit of granting us more than we ask or imagine.)
So in between Job and Revelation, how did God operate? And why do we have four gospels, not fewer or more? There are other questions on SO about that, but the early church fathers had the idea (with details they disagreed about) that the four living creatures in Ezekiel match the four in Revelation match the four gospels. The disagreement is over which animal goes with which gospel. Other writers further connect the four animals to the banners flown by the four principle tribes in Numbers 2.
For example see this website: http://www.biblefragrances.com/studies/fourbanners.html
An excerpt:
Jerome Prado, in his commentary upon Ezekiel (Ezekiel 1 p. 44), gives
the following minute description according to rabbinical tradition:
“The different leaders of the tribes had their own standards, with the
crests of their ancestors depicted upon them. On the east, above the
tent of Naasson the first-born of Judah, there shone a standard of a
green colour, this colour having been adopted by him because it was in
a green stone, viz., an emerald, that the name of his forefather Judah
was engraved on the breastplate of the high priest (Ex. 25:15ff.), and
on this standard there was depicted a lion, the crest and hieroglyphic
of his ancestor Judah, whom Jacob had compared to a lion, saying,
‘Judah is a lion’s whelp.’ Towards the south, above the tent of Elisur
the son of Reuben, there floated a red standard, having the colour of
the sardus, on which the name of his father, viz., Reuben, was
engraved upon the breastplate of the high priest. The symbol depicted
upon this standard was a human head, because Reuben was the
first-born, and head of the family. On the west, above the tent of
Elishamah the son of Ephraim, there was a golden flag, on which the
head of a calf was depicted, because it was through the vision of the
calves or oxen that his ancestor Joseph had predicted and provided for
the famine in Egypt (Gen. 41); and hence Moses, when blessing the
tribe of Joseph, i.e., Ephraim (Deu. 33:17), said, ‘his glory is that
of the first-born of a bull.’ The golden splendour of the standard of
Ephraim resembled that of the chrysolite, in which the name of Ephraim
was engraved upon the breastplate. Towards the north, above the tent
of Ahiezer the son of Dan, there floated a motley standard of white
and red, like the jaspis (or, as some say, a carbuncle), in which the
name of Dan was engraved upon the breastplate. The crest upon this was
an eagle, the great doe to serpents, which had been chosen by the
leader in the place of a serpent, because his forefather Jacob had
compared Dan to a serpent, saying, ‘Dan is a serpent in the way, an
adder (cerastes, a horned snake) in the path;’ but Ahiezer substituted
the eagle, the destroyer of serpents as he shrank from carrying an
adder upon his flag.”15
One article about the association of animals with gospels is here:
https://aleteia.org/2016/12/27/do-you-know-the-meanings-of-the-creatures-in-the-tetramorph/
It takes the position of St. Jerome, and here is a quote:
Matthew is associated with the winged man — or the angel — because his
Gospel focuses on the humanity of Christ, Saint Jerome affirms. In
fact, it is Matthew who includes the narrative about the genealogy of
Jesus.
The lion is related to St. Mark because his Gospel emphasizes the
majesty of Christ and his royal dignity, just as the lion has
traditionally been regarded as the king of beasts. Mark’s Gospel
begins with the prophetic voice of John the Baptist, crying out in the
wilderness like a lion’s roar.
Luke gets the ox, because his gospel focuses on the sacrificial
character of Christ’s death, and the ox has always been a sacrificial
animal par excellence, both for Judaism and Roman paganism. In Luke’s
depiction of the Nativity, the ox, with the donkey, bears witness to
the birth of the Messiah.
John, finally, is associated with the eagle for two reasons: first,
because his Gospel describes the Incarnation of the divine Logos, and
the eagle is a symbol of that which comes from above. The second,
because like the eagle, John — in his Revelation — was able to see
beyond what is immediately present. They don’t call St. John the
Evangelist “the Eagle of Patmos” for nothing!
Another writer (I lost the link) said that the four major tribes marched in a certain order in Numbers, and that order of animals corresponds to the order that the Gospels appear in our Bibles.
Okay, so there is scriptural support (disputed by some, I agree) that God planned for there to be four gospels. But which ones?
Let's start with Paul. As Saul, he obtained letters to take to Damascus to arrest and confiscate the belongings of followers of Jesus. Then he saw Jesus on the Road to Damascus and was told what he would do to suffer for that name. And what did Paul do? He wrote lots of letters to teach and support churches - not destroy them, and they constitute a huge chunk of the New Testament.
But, you say, those are not Gospels! However, it shows how one New Testament writer received his commission. There is also this curious statement from Romans:
16 This will take place on the day when God judges people’s secrets
through Jesus Christ, as my gospel declares. (Romans 2:16)
Most take this to mean that Paul is referring to the good news he is preaching about Jesus, not a full biographical gospel. However, one commentator says that in fact, Paul DID write a Gospel: the Gospel of Luke! Luke was not a Jew and not a disciple prior to the resurrection nor a witness of the resurrection. He was not qualified to write Holy Scripture - unless he were the scribe for one who WAS a witness of the risen Christ. Luke was Paul's disciple, traveling companion, biographer and friend.
Therefore, we have Paul under Jesus' orders to change his life and send letters of grace and not destruction to churches, mentoring Luke as he wrote the Gospel bearing his name.
In like fashion, John Mark was a disciple of Peter and wrote his gospel.
As another answerer also said, St. John DID get a command from Jesus to write down Revelation, so we can assume that he had similar communications concerning his other writings.
One last comment: preparation. The discples needed further preparation before they could write the Gospels.
- Wisdom to interpret Scripture.
44 He said to them, “This is what I told you while I was still with
you: Everything must be fulfilled that is written about me in the Law
of Moses, the Prophets and the Psalms.”
45 Then he opened their minds so they could understand the Scriptures.
The two who were walking on the road to Emmaus required for Jesus to open their minds to understand Scripture. I am sure that Jesus, or the Holy Spirit, had to repeat that for the other disciples.
- Power.
But you will receive power when the Holy Spirit comes on you; and you
will be my witnesses in Jerusalem, and in all Judea and Samaria, and
to the ends of the earth.” (Acts 1:8)
Until they received the power of the indwelling Holy Spirit, the disciples were not prepared to spread the good news.
To wrap up, God planned it all out - when to start the Bible, when to finish it, how many Gospels, and how to prepare their writers.