Below is an excerpt from Bart Ehrman who is a Biblical Scholar. You can check his sources and see that his claims are 100% true. The Gospels were written anonymously in the name of people.
Most likely, not one of the gospels were written by anyone who knew Jesus personally.
2. All the Gospels are Anonymous Until 180-185CE 6
“The four Gospels... are all anonymous, written in the third person
about Jesus and his companions. None of them contains a first-person narrative ("One day, when Jesus and I went into Capernaum..."), or claims to be written by an eyewitness or companion of an eyewitness. Why then do we call them
Matthew,
Mark,
Luke and
John? Because sometime in the second century, when proto-orthodox Christians recognized the need for
apostolic authorities, they attributed these books to apostles (
Matthew and
John) and close companions of apostles (
Mark, the secretary of Peter; and
Luke, the travelling companion of Paul). Most scholars today have abandoned these identifications, and recognize that the books were written by otherwise unknown but relatively well-educated Greek-speaking (and writing) Christians during the second half of the first century.”
"
Lost Christianities" by Bart Ehrman (2003)
7
“Justin Martyr, writing around 150-60
CE, quotes verses from the Gospels, but does not indicate what the Gospels were named. For Justin, these books are simply known, collectively, as the 'Memoires of the Apostles.' It was about a century after the Gospels had been originally put in circulation that they were definitively named Matthew, Mark, Luke, and John. This comes, for the first time, in the writings of the church father and heresiologist Irenaeus, around 180-85
CE.”
"
Forged" by Bart Ehrman (2011)
3
Ehrman kindly points out that the gospels were not
forgeries - they were anonymous, and it was a case of
false attribution8 by Christians later on that was the cause of the misdirection which lasted many hundreds of years.