Unlike the epistles, which have the author's name at the beginning, the gospels do not say who wrote them. How did the names Matthew, Mark, Luke, and John get attached to them, and how certain can we be that these are the actual authors?
They are named that way by tradition and we cannot be 100% sure that the tradition is accurate.
- While the early Christians say that Matthew was written in either Hebrew or Aramaic, more recent scholarship suggests otherwise. Our only sources, though, are from at least a half generation later.
- The only evidence we have of Mark's authorship are writings over a generation later.
- Luke/Acts's author can partially be inferred from contents of the New Testament, but we still can't be sure.
- John also has tradition associated with it being written from Patmos (and there are some apocryphal stories which date back to the early Christian era), but the long and the short is that we can't even guarantee that everything attributed to John in the New Testament is actually by the same man.
Then there are questions like how does Q measure into this, or was their a Q to begin with? (My Hebrew professor actually believed in the traditional order Matthew-Mark-Luke). (Personally, my guess is that there actually was a gospel penned by Matthew in either Hebrew or Aramaic, it was then translated into the Greek and amended to become the Gospel we know today, the original would serve as Q, however. Of course, I am a programmer, not a theologian).