In his Introduction to the Gospel of Matthew, Heinrich Meyer wrote,
It was Matthew who, before he passed over to the service of Jesus, was called Levi, and was a collector of taxes by the lake of Tiberias, where he was called away by Jesus from the receipt of custom. From Matthew 9:9, compared with Mark 2:14 and Luke 5:27, it is sufficiently evident that the two names Matthew and Levi denote the same individual; for the agreement between these passages in language and contents is so obvious, that Levi, who is manifestly called to be an apostle, and whose name is yet wanting in all the lists of the apostles, must be found again in that Matthew who is named in all these lists; so that we must assume that, in conformity with the custom of the Jews to adopt on the occasion of decisive changes in their life a name indicative of the change, he called himself, after his entrance on the apostolate, no longer לֵוִי, but מַתָּאִי, i.e. מַתַּנְיָה (Theodore = Gift of God).
This name, as in the cases of Peter and Paul, so completely displaced the old one, that even in the history of his call, given in our Gospel of Matthew, he is, at the expense of accuracy, called, in virtue of a historical ὕστερον πρότερον, by the new name (Matthew 9:9); while Mark, on the other hand, and after him Luke, observing here greater exactness, designate the tax-gatherer, in their narrative of his call, by his Jewish name, in doing which they might assume that his identity with the Apostle Matthew was universally known; while in their lists of the apostles (Mark 3:18; Luke 6:15; Acts 1:13), where the apostolic names must stand, they rightly place the name Matthew.
As for being the author of the first Gospel (according to the order established in most English translations), we only have tradition (rather than an actual statement in the Bible itself) that attributes him as its author.