Matthew, the tax collector, was one of the 12 disciples; he was the son of Alphaeus, and the brother of James the Less, who was also one of the 12.
John was the son of Zebedee, and the brother of James the Greater; they were both members of the 12. John was the youngest disciple, probably just a boy in his early teens when Jesus chose him.
Mark, known as John Mark, was an early convert to the Christian Faith, possibly brought in by the Apostle Paul. The same for Luke, who was a medical doctor. Neither of them were members of the original 12 disciples.
As for who wrote the four Gospels, traditionally they have been ascribed to the men whose names they bear. Whether those four men actually, personally, did write the four Gospels or not, is, I'm happy to say, more or less irrelevant. The Gospels were divinely inspired, directly by God, through the Holy Spirit, to contain the things He wanted us to know.
Their authority does not come from their authors, nor from the Bible, but from the Magisterium of the Church. It is the Church, after all, which determined what was Holy Scripture and what was not---again, led by the Holy Spirit Himself. So, ultimately, it makes no difference who actually wrote them----the important thing is that we believe what they contain, and allow their message to lead us closer to Christ.