Whether capital punishment deters murder more effectively than long imprisonment is an empirical question that has been studied for over half a century without resolution. It is worth separating carefully from the moral argument, since people who agree completely about the evidence may still disagree about whether execution is permissible, and people who agree it is wrong may still differ on whether it works.
The deterrence argument is straightforward: people respond to incentives, execution is the most severe penalty available, so it should suppress the conduct it punishes more than a lesser penalty does. Cesare Beccaria, writing in 1764, accepted the premise about incentives and drew the opposite conclusion, arguing that the certainty of punishment deters far more effectively than its severity, and that a long visible sentence impresses the mind more than a brief spectacle. His argument set the terms still used today.

Studies claiming a deterrent effect. Isaac Ehrlich's work in the 1970s reported that each execution prevented several murders, and it was cited to the United States Supreme Court. A cluster of econometric studies in the 1990s and 2000s reported similar findings using state-level panel data.
Studies finding none. A far larger body of work finds no measurable effect. Comparisons between neighbouring jurisdictions with and without the penalty generally show no difference in homicide rates attributable to it. States that abolished capital punishment did not experience the increases the deterrence hypothesis predicts, and in the United States states without the death penalty have generally had lower murder rates than those with it, though the direction of causation there is unclear.
The methodological verdict. In 2012 a United States National Research Council panel reviewed three decades of research and concluded that the studies were fundamentally flawed and should not be used to inform policy in either direction. The panel's objection was structural: the studies cannot adequately model what potential murderers believe the alternative punishment to be, executions are too rare and too delayed for the statistical models to identify an effect reliably, and results proved highly sensitive to modelling choices. Its conclusion was not that there is no deterrent effect but that the available evidence cannot establish whether there is one.

Several points are agreed across the argument. Homicide is frequently committed under intoxication, extreme emotion, or mental illness, conditions in which calculation of consequences is impaired, which limits how much any penalty can deter. Detection and conviction rates matter more to deterrence than sentence severity, which is Beccaria's point restated with modern data. Capital cases cost more than life imprisonment in jurisdictions with extensive appellate review. And wrongful convictions occur: substantial numbers of people sentenced to death have later been exonerated, which is a cost with no equivalent in reversible sentences.
The question is unusually difficult to settle empirically. The treatment is rare, the outcome is rare, the affected population is small, and jurisdictions differ in a great many ways at once. Both sides accuse the other of choosing specifications that produce the desired answer. It is reasonable to conclude that the deterrent effect, if it exists, is too small to be detected by available methods, which is itself informative for a policy justified primarily on deterrent grounds.