We are introduced to Matthew Levi when Yeshua is with Pontius Pilate. Yeshua distances himself from what this man writes about him. "I said decidedly nothing of what's written there", he says when Pilate confronts him with Matthew's writings.
Matthew starts playing an active role in the novel at Bald Mountain, when Ha-Nozri is executed. He is the only spectator - except for the executioners - of what happens. He didn't chose the most convenient spot to observe the events, but the worse, on the northside, where the slope was not gentle and accessible, under a fig tree wich gave no shade. He's totally in despair, because the day of Yeshua's arrest he had been with him the whole day, but had let him return to Yershalaim alone. At night he could not go back to him neither, because he had become ill. When the procurator announced the verdict, he was part of the crowd.
He gets the idea to approach Yeshua before the execution, while he's climbing Bald Mountain, to stab him in the back with a knife to save him from more suffering, but Levi had no knife with him. Nor did he have a single piece of money. So he steals a knife in a a little shop where bread was sold near the Hebron gate, "just as you enter the city, on the left". But the procession was no longer in sight. Together with Matthew Levi we follow the execution and we see how the thunderstorm bursts when Yeshua Ha-Nozri dies. After that both Levi and the body of Yeshua were gone from the hilltop.
The guards find Matthew Levi with the body of Yeshua in a cave. Levi is in despair and wrath. They succeed to quiet the impudent madman, by explaining to him that the body would be buried. He's even allowed to take part in the burial and brought to Pilate. Which was very convenient, because he wanted to talk to him. Pilate wants to know what Levi wrote on the charta he carries with him, on which Yeshua's words are written down. Matthew let him read it, but the last lines "... greater vice... cowardice" make him shiver. Pilate offers Levi a job as a librarian in Caesarea, but Levi refuses. He says that he wants to devote the rest of his life on trying to kill Judas of Kiriath. "Don't trouble yourself", Pilate replies, "Judas has already been killed this night. I did it" Pilate asks Matthew if he really don't want to take something and yes, he want a piece of clean parchment
At the end of the novel, when Woland looks over Moscow from a stone terrace, Matthew Levi reappears. He says that "He" had sent him. "He" has read the Master's work en sends Levi to Woland to ask him to take the Master and Margarita with him and reward him with peace. "We would never have thought of it without you", Woland says, "go". And Matthew Levi disappeared after that.
Most christians believe that the evangelist Matthew is the same person as the apostle Matthew, originally named Levi. It is very doubtful that this is possible, because it would mean that Matthew would have been very old when he wrote his gospel. Most Bible experts estimate the origin of the gospels as follows: Mark circa 65; Luke circa 80-85; Matthew circa 85-90; John circa 90-100. Others date the first three gospels somewhat earlier: Mark shortly after 60; Luke between 60 and 70 and Matthew shortly after 70.
In the novel Jesus and Matthew Levi know each other, but not long enough to speak of an apostle. Bulgakov refers clearly to the evangelist - "one with a goatskin parchment who follows me, follows me and keeps writing all the time", Yeshua says about him.
By the way, Bulgakov never mentions the apostles in the novel. Although he makes Aphranius say that, "though we have been unable - so far at least - to discover any admirers or followers of his, it is none the less impossible to guarantee that there are none". But further they have no role, they aren't even mentioned. Just Matthew Levi is called once or twice a "disciple", though it's only by himself: "I, Matthew, your faithful and only disciple". Bulgakov's Matthew Levi has characteristics from both the apostle as the evangelist. He's a tax collector, like the apostle Matthew Levi, and wrote down the acts of Jesus, like the evangelist Matthew.
The apostle Matthew's calling by Jesus was rather controversial. After a conflict with the scribes Jesus leaves the city and goes to the Lake Tiberias also called the Sea of Galilee. Along Capernaum, a town near the lake, was a seaway, the main road from Syria to Egypt. All goods entering Herodes' territory, were taxed at the Capernaum tollbooth, it was one of the four taxes that had to be paid. The tax collectors collected the tolls for the occupying force and often demanded more money than required to keep the rest for themselves. People hated them and they were so despised that their money was not accepted by the Jewish as alms and that their testimony was not legitimated in Jewish courts, because they were ritually unclean by their contacts with heathens. Matthew, called Levi by Mark and Luke, was such tax collector and the fact that Jesus called this man, must have been questionable for many Jews. When Jesus calls him, Matthew leaves his job and his old life behind him and follows Jesus as his disciple. Then they go into Matthew's house and have a festive meal, with Jesus, his disciples and many tax collectors and sinners.
The evangelist Matthew describes the calling of the apostle Matthew as follows: 9:9 - As Jesus passed on from there, he saw a man named Matthew sitting at the customs post. He said to him, "Follow me." And he got up and followed him.