When did the Catholic Church first distinguish mortal from venial sin?
The term mortal sin is thought to be derived from the Gospels. Specifically, it has been suggested that the term comes from the 1 John 5:16–17. Thus the Church distinguished sins from mortal and venial from the Apostles themselves.
16 He that knoweth his brother to sin a sin which is not to death, let him ask, and life shall be given to him, who sinneth not to death. There is a sin unto death: for that I say not that any man ask.
17 All iniquity is sin. And there is a sin unto death. - 1 John 5:16-17
The early Church Fathers were unanimous in teaching the reality of mortal sin.
The concept is hinted at in some works of the early Fathers of the Church and explicit in others.
Fathers of the Church
In AD 220, Tertullian in his De Modestia, 21 writes,
Discipline governs a man, power sets a seal upon him; apart from the fact that power is the Spirit, but the Spirit is God. What, moreover, used [the Spirit] to teach? That there must be no communicating with the works of darkness. Observe what he bids. Who, moreover, was able to forgive sins? This is his alone prerogative: for ‘who remits sins but God alone?’ and, of course, [who but he can remit] mortal sins, such as have been committed against himself and against his temple?
In AD 385, Pacian of Barcelona, in his Sermon Exhorting to Penance, gives contempt of God, murder, and fornication as examples of "mortal" or "capital sins."
In AD 393, St. Jerome writes:
There are venial sins and there are mortal sins. It is one thing to owe ten thousand talents, another to owe but a farthing. We shall have to give an accounting for an idle word no less than for adultery. But to be made to blush and to be tortured are not the same thing; not the same thing to grow red in the face and to be in agony for a long time. . . . If we entreat for lesser sins we are granted pardon, but for greater sins, it is difficult to obtain our request. There is a great difference between one sin and another. — Against Jovinianus, 2:30
Here are a few examples of what some of the Church Fathers had to say on the subject of mortal sin:
“There are venial sins and there are mortal sins. It is one thing to owe ten thousand talents, another to owe but a farthing. We shall have to give an accounting for an idle word no less than for adultery. But to be made to blush and to be tortured are not the same thing; not the same thing to grow red in the face and to be in agony for a long time. . . . If we entreat for lesser sins we are granted pardon, but for greater sins, it is difficult to obtain our request. There is a great difference between one sin and another” (Against Jovinian 2:30 [A.D. 393]).
Caesarius of Arles
“Although the apostle [Paul] has mentioned many grievous sins, we, nevertheless, lest we seem to promote despair, will state briefly what they are. Sacrilege, murder, adultery, false witness, theft, robbery, pride, envy, avarice, and, if it is of long standing, anger, drunkenness, if it is persistent, and slander are reckoned in their number. Or if anyone knows that these sins dominate him, if he does not do penance worthily and for a long time, if such time is given him . . . he cannot be purged in that transitory fire of which the apostle spoke [1 Cor. 3:11–15], but the eternal flames will torture him without any remedy. But since the lesser sins are, of course, known to all, and it would take too long to mention them all, it will be necessary for us only to name some of them. . . . There is no doubt that these and similar deeds belong to the lesser sins which, as I said before, can scarcely be counted, and from which not only all Christian people, but even all the saints could not and cannot always be free. We do not, of course, believe that the soul is killed by these sins, but still they make it ugly by covering it as if with some kind of pustules and, as it were, with horrible scabs” (Sermons 179:2 [A.D. 522]).