Cook, who took over the role in 2012, has skippered England in a record 59 Tests.
The 32-year-old led England to Ashes victories in 2013 and 2015, and notable series wins in both South Africa and India.
But he discussed his position with ECB chairman Colin Graves on Sunday following the 4-0 Test series defeat in India at the end of last year and has now decided to quit.
Cook has not retired, and will continue to open the batting for England in their next Test series against South Africa in July.
Alastair Cook has stepped down from his role as England captain
Playing for England really is a privilege and I hope to carry on as a Test player
“It’s been a huge honour to be England captain and to lead the Test team over the past five years," Cook said.
“Stepping down has been an incredibly hard decision but I know this is the correct decision for me and at the right time for the team.
“I’ve had time to reflect after the India series and this weekend I spoke to Colin Graves, the Chairman, to explain and offer my resignation.
Alastair Cook steps down as England Test captain
Mon, February 6, 2017
Alastair Cook has stepped down as England Test captain
Get Quotes on Home Insurance
1 of 6
Alastair Cook has stepped down from his role as England Test captain
“It’s a sad day personally in many ways but I want to thank everyone I’ve captained, all the coaches and support staff and, of course, the England supporters and the Barmy Army who follow us home and away and have given us unwavering support.
“Playing for England really is a privilege and I hope to carry on as a Test player, making a full contribution and helping the next England captain and the team however I can.”
Alastair Cook captained England to Ashes glory in 2013 and 2015
Engand have started the process of selecting Cook's successor, with his fellow batsman Joe Root the favourite for the role.
Director of cricket Andrew Strauss said the ECB hoped to make an appointment before England depart for a three-match one-day international series in the West Indies on 22 February.
Strauss, who Cook replaced as captain, said: “I want to thank Alastair, on behalf of the ECB and from a personal perspective, for the fantastic contribution that he’s made to the England Test team since taking over as Captain in 2012.
Joe Root is the favourite to replace Alastair Cook as England Test captain
"His country owes him a great debt of gratitude; he's led the team with determination, conviction and a huge amount of pride over the last five years and his record stands for itself. With more matches leading the team than anyone, including two Ashes wins, he deserves to be seen as one of our country's great captains.
"Alastair will be missed in his capacity as Captain but I hope that he has a number of years left to add to his record-breaking feats as an opening batsman and look forward to his continued success.
“We now move on with the process of appointing the right successor. There are a number of established players who are playing formal or informal leadership roles and whilst we've rightly not spoken to anyone in relation to the Test captaincy so far, we can now talk fully and openly within the team. We expect to be able to make an announcement before the team head to the West Indies on 22nd February.”