There is no direct connection. But a respect for human rights is required to belong to the EU. Leaving the ECHR would cast the UKs commitment to human rights into question (at the very least it would be an indication that the UK has a different conception of human rights to the rest of the EU) and would mean that the EU would have to scrutinise whatever legislation took its place to ensure that the UK did still intend to retain a conception of human rights close enough to the other member states.
None of this means that the recent referendum gave any mandate for leaving the ECHR.