The 33-year-old former England captain, who has made a national record 12,254 runs in a 160-Test career over 12 years, will retire after this week's Test against India.