When were the Gospels written? This is an important question.
Most scholars date the Gospels between 40 and 65 years from the death of Christ as follows: Mark 70 AD, Matthew 80 AD, Luke 85 AD and John 95 AD. The scholarly position is stated concisely in the narrative on Dating the Gospels linked here. Other scholars date them much earlier than that, but Gary Habermas, adopts the majority scholarly view in making his argument for the historical resurrection. (Gary Habermas Explains The Earliest Source Of Resurrection Facts.)
Virtually no one disagrees that Paul’s letters (the ones scholars concede) were written in the 50’s AD. James, Peter and Paul all died in the 60’s AD during the persecution of Christians by Rome. Another key date is the destruction of the Temple in Jerusalem in 70 AD. The scholarly consensus is that “the deaths of these important figures likely encouraged the writing down of the narratives about Jesus” (though, some scholars maintain the narratives were written down well before that time).
(Incidentally, scholars in the 19th Century began to posit the idea that the Gospels were written much later, as in the 2nd Century, and that the Gospels were not written by the people attributed to them. That view of the Gospels grew into the 20th Century, but modern scholars have backed off that view and concede that the Gospels were written within a generation of the death of Jesus.)
Most scholars agree that Mark was the first Gospel to be written, and that Mark was written around the year 70 AD. Most scholars believe the Gospels of Matthew and Luke were composed in the 80’s, using Mark as source material and a “collection of Jesus’s sayings” (oral tradition). The Gospel of John was believed to derive from different sources (like the Apostle John, himself).
While there is some disagreement on how early the Gospels were written, the scholarly work of Gary Habermas has convinced most scholars, even skeptical ones, that the message of the Gospel – that Jesus, lived, died and rose from the dead, appearing to his followers – goes back many years before the Gospels are believed to have been written. In fact, it goes back to the very beginning. Since scholars agree that the letters of Paul were written in the AD 50’s, that is a good starting place. We know Paul died in the AD 60’s. We can also pinpoint some of the letters by their internal references.
For instance, we know that Paul’s conversion was within three years of the death of Jesus. In Galatians 1, Paul describes that he immediately left Jerusalem after he had an encounter with Jesus (because he was being sought by the authorities in Jerusalem after such a public conversion) and went to Damascus. Three years later he returned to Jerusalem and met with Peter and James (the brother of Jesus and head of the Church in Jerusalem). Then Paul went to Syria and Cilicia. In Galatians 2, Paul recounts that he was away for 14 years when he returned again to Jerusalem.
At least 20 years went by from the death of Jesus to the time when Paul wrote the letter to the Galatians according to the timeline related in the letter. We also know that Paul died in the AD 60’s. That means the letter to the Galatians was written within about 20 to 30 years after the death of Jesus (30-33 AD). Therefore, the letter to the Galatians was written in the AD 50’s (or early 60’s at the very latest).
The Book of Acts was likely completed before Paul’s death in the AD 60’s. We believe this because the Book of Acts was written by Luke, the traveling companion of Paul. It describes much of Paul’s life and ministry, but it doesn’t mention his death. It leaves off with Paul imprisoned in Rome. It also doesn’t mention the martyrdom of James. (Josephus, a contemporary Jewish historian, recounts that James was stoned to death in Jerusalem in the early 60’s AD.) Since Luke doesn’t mention the death of James, the Book of Acts was likely written before the mid-60’s AD.
James was not only the brother of Jesus; he was the head of the church in Jerusalem. His death would have been of utmost significance to the young followers of Christ everywhere. The death of Paul and of James would most certainly have been mentioned by Luke if Acts was written after the date of their deaths.
There are reasons to believe the Book of Acts was written before 63 AD. For instance, the temple in Jerusalem was destroyed in 70 AD, but that isn’t mentioned. Acts is silent about Nero’s persecution of the Christians in A.D. 64 and the deaths of the apostle, James (A.D. 62), Paul (A.D. 64), and Peter (A.D. 65). None of these key events are mentioned in the chronicle of the events of the early church found in the Book of Acts. The absence of these key happenings suggest that the Book of Acts was written before those events took place.
In fact, one of the last historical events chronicled by Luke in Acts is the appointment of Porcius Festus as procurator of Judea (Acts 24:27), which took place in about 59 AD. According to Luke, Festus refused to let Paul free from prison in Judea, and Paul was removed to Rome where he was later martyred.
The very last events described in Acts involve the journey of Paul to Rome where he remained under some kind of house arrest for two years. (Acts 28:30) Paul died in 64 AD. James died two years earlier in Judea, but news didn’t travel fast in the 1st Century. Luke, who accompanied Paul to Rome, wouldn’t have known of the death immediately.
The Gospel of Luke was written prior to the Book of Acts because the Gospel of Luke is the first half of the work that includes Luke and Acts. If the source material for Mark’s Gospel was also used by Luke, Mark’s Gospel had to predate Luke. That would suggest a date for Mark and Luke closer to the time of the Pauline Epistles, which we know were written in the 50’s AD.
Based on the dating of the Pauline Epistles, we must conclude that the Gospels were written around the time of, or even before, the mid-50’s AD. The window between the events and the writings that describe those events is likely no less than 20-30 years.
Perhaps, the main reason that scholars began dating the Gospels later in time is the destruction of the temple in Jerusalem. It isn’t mentioned in any of the New Testament writings, other than in future tense. Jesus says in various Gospel accounts that the temple will be destroyed.
If the Gospels were written before the destruction of the temple in Jerusalem, then Jesus predicted the destruction. But modern scholars typically don’t believe in miracles, and they don’t believe in prophecies. Many modern scholars won’t concede that Jesus is who he claimed to be – the Messiah predicted in the Old Testament, the Son of Man and Son of God, God who became flesh and dwelt among us. Some scholars date the Gospels as late as they can get away with because an earlier date doesn’t fit their worldviews.
These are compelling arguments to suggest the Gospels were written earlier than modern scholars concede. (There are more reasons to date the Gospels prior to the destruction of the temple.) Even if we accept the consensus dates, the Gospels are clearly not 2nd Century legend or myth, written generations after the events they describe. They were written at a time when people were still alive who could recall those events. This is born out in the 15th Chapter of the first letter Paul wrote to the Corinthians:
For I delivered to you as of first importance what I also received, that Christ died for our sins according to the Scriptures, and that He was buried, and that He was raised on the third day according to the Scriptures, and that He appeared to Cephas [Peter], then to the twelve. After that He appeared to more than five hundred brethren at one time, most of whom remain until now, but some have fallen asleep; then He appeared to James, then to all the apostles; and last of all, as to one untimely born, He appeared to me also. (1 Cor. 15:3-8)
In recounting the order of the appearance of the resurrected Christ to different people (including “more than five hundred at one time”), Paul observes that “most remain until now”! When Paul wrote that letter, which scholars have pinpointed to about 55 AD, most of the people that he claimed had seen the resurrected Jesus were still alive!
That is a large group of people still alive who could refute that statement, if they were untrue. As a result, most scholars actually accept as fact that the apostles and early followers of Jesus believed Jesus rose from the dead and appeared to a large group of people. Most scholars now concede that this was their story, their testimony, from the very beginning, and some skeptics even concede that these people saw Jesus (though they tend to believe that they were hallucinating or some such thing). The fact that the early followers of Christ preached the resurrection from the beginning is one of many arguments that support the historicity of the resurrection.
These things do not prove the resurrection, of course (as in proof beyond all doubt), but it is strong evidence. How many people would follow a dead man and give their lives for a lie? People might do that for a myth, but not for a story based on factual assertions that are known to be false. History bears out that they believed the story because many of them died for it.
Some of the early Church writers were also around to speak with the apostles and others who knew Jesus, firsthand. Papias wrote of his relationship with John the Apostle, the daughters of Philip and many of the elders who had themselves heard the Twelve Apostles. Papias lived from 70-163 AD, and was a companion of Polycarp who lived from 69-155 AD. Papias demonstrated a keen interest in preserving “the truth” from the closest sources he could find, which were people who knew Jesus.
Polycarp was a disciple of John the Apostle. He heard firsthand the accounts of Jesus from John, who was one of Jesus’s closest companions. Ignatius, having been born just a few years after the death of Jesus, was a contemporary with all of the people who knew Jesus. He was a disciple of John. Peter, himself, appointed Ignatius the Bishop of Antioch. Polycarp would have spoken to Peter and John and others firsthand about their memory of Jesus.
Whether the Gospels were written before the Pauline Epistles or after them, the central aspect of the Gospels, that Jesus lived, died, rose again from the dead, and appeared to his followers, was the message that was conveyed from the very beginning. It wasn’t developed generations or centuries later. We know this from the external sources and the internal references that we can pinpoint in time, as well as from the accounts of contemporaries of the people who walked with Jesus and knew him personally.
These things lend significance to the statement made by Peter:
For we did not follow cleverly devised tales when we made known to you the power and coming of our Lord Jesus Christ, but we were eyewitnesses of His majesty. (2 Peter 1:16)
 See https://en.wikipedia.org/wiki/Papias_of_Hierapolis – Papias wrote, “For unlike most people I took no pleasure in those who told many different stories, but only in those who taught the truth. Nor did I take pleasure in those who reported their memory of someone else’s commandments, but only in those who reported their memory of the commandments given by the Lord to the faith and proceeding from the Truth itself…. I made enquiries about the words of the elders—what Andrew or Peter had said, or Philip or Thomas or James or John or Matthew or any other of the Lord’s disciples, and whatever Aristion and John the Elder, the Lord’s disciples, were saying.”
 Irenaeus, who was a companion of Polycarp, wrote about how Polycarp “conversed with John and many others who had seen Jesus Christ, the words he had heard from their mouths”.