From the Catechism:
#2267 (LINK) Assuming that the guilty party's identity and responsibility have been fully determined, the traditional teaching of the Church does not exclude recourse to the death penalty, if this is the only possible way of effectively defending human lives against the unjust aggressor. If, however, non-lethal means are sufficient to defend and protect people's safety from the aggressor, authority will limit itself to such means, as these are more in keeping with the concrete conditions of the common good and are more in conformity to the dignity of the human person.
Today, in fact, as a consequence of the possibilities which the state has for effectively preventing crime, by rendering one who has committed an offense incapable of doing harm - without definitely taking away from him the possibility of redeeming himself - the cases in which the execution of the offender is an absolute necessity "are very rare, if not practically non-existent."
The last paragraph ("Today, in fact...") is a prudential judgment, not a universal doctrine. That is, an attempted assessment of particular times and places where the severity of capital punishment could be foregone by the substitution of, for instance, life imprisonment without possibility of parole.
Many have noted, with reason, that even a murderer with a life sentence can still aggress against others, e.g. by assault upon a guard or another prison staffer or another prisoner, and that these cases there would be no other recourse except the death penalty.
add an element to Paul's words recorded in Romans where that determination belongs to the legitimate authority.