Its the ECHR that prevents us from having the death penalty. All members of the EU are required to be signatories of the ECHR. Leaving the EU wouldn’t change our position on the ECHR, that would require a definitive politic process. We would also have to repeal the Human Rights Act 1998.It would simply require the withdrawal from the European Union.
The HRA 1998 is considered by many to be an important constitutional act and also entrenched making it difficult to repeal.