He revealed he had first considered resigning at the start of the year during the tour of New Zealand, when England came back from 1-0 down to win 2-1.
Vaughan said: "In New Zealand I had a few thoughts that I might go. It is a fairytale to captain your country but it hasn't had a fairytale ending. I know that it is the right time because my mind told me it was. My body is working well but my mind is not.
"I wish whoever gets the job all the luck in the world, it's a great privilege."
Vaughan's decision came a day after England lost the third Test to South Africa, and with it the series. It was their third series loss in their last five rubbers.
He went on: "We've beaten New Zealand twice but lost to three big teams. I want to take this little break and then come back and finish the season for Yorkshire.
"I have to score runs like everyone else and put myself in the frame for selection. I believe these will be the best years of my playing career. I won't hit any balls for a few weeks but then I want to come back and score some runs."
Aggers tips Pietersen for captaincy
He said his decision had shocked his team-mates, still crestfallen after events at Edgbaston on Saturday when England looked poised for victory at tea.
"It came as a huge surprise for the players. The one regret is that I didn't stand in front of them yesterday. They were completely gutted in the dressing room and I didn't have it in me. I hope they respect my decision."
Vaughan said he had made a decision earlier in the summer to quit if his team were unable to beat South Africa, and he delivered on his promise to himself.
He said: "There have been people who I have talked to but once your mind is made up it is hard to go back. I've always gone on my gut instinct – I've played my best innings on gut instinct – and this was the right time.
"I haven't been involved in any discussions [over the new captain]. I just had to make this decision because it was the right one.
"Whoever gets the privilege to captain his country will need a bit of time to establish himself as a lead. The England team really needs someone to lead them in the right direction.
"I've tried to be me throughout the whole period as captain. One of the things that has really hurt me in the last six months is that I haven't been me.
He took the England captaincy to new heights. Michael was the best possible ambassador for the game
Hugh Morris, England team managing director
"A big disappointment for me is that I haven't managed to get through to next year. Whoever gets the job will have about nine matches before the Ashes so he will be inexperienced but will have fresh ideas."
Hugh Morris, managing director of the England team, said of Vaughan: "He was undoubtedly the catalyst for regaining the Ashes in 2005.
"His legacy will be felt for many years to come. We expect him to play a significant role in English cricket in the future.
"Michael led from the front and led with honesty and integrity every step of the way.
"He took the England captaincy to new heights. Michael was the best possible ambassador for the game and his record as captain speaks volumes for the character he instilled in the dressing room."
South Africa captain Graeme Smith, who had barely started in his own job when Vaughan replaced Nasser Hussain for the second Test against South Africa at Lord's in 2003, said: "It has come as a shock to me.
"I have the highest regard for him as person, sportsman and leader. It is a great loss for world cricket."
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.