In a statement, he said he had decided to resign for medical reasons.
He said he is receiving treatment for a condition which is “irreversible and progressive”.
He decided to hand in his resignation because he can no longer fulfil his diocesan role.
Dr Hegarty, who is 71, and from Kilcar, has been Bishop of Derry since 1994 having served as Bishop of Raphoe. He was ordained as a priest in 1966, and was consecrated Bishop of Raphoe in 1982.
In recent years he urged anyone who has been abused by a member of the clergy to go to the civil authorities, and apologised to people who suffered child abuse in Catholic-run institutions.
Dr Hegarty has said he will scale back his duties while the Pope considers his letter of resignation, but he hopes to maintain a pastoral ministery as long as he is able.
Dr Hegarty’s resignation comes just days before the expected audit into child abuse in the Diocese of Raphoe is expected to be published.