Good question.
All four of the canonical gospels were originally anonymous. It was only in the second century CE, when the four gospels were published as a collection that superscriptions were added, attributing authorship to Matthew, Mark, Luke, and John respectively. This is also the time...