The deal effectively replaces the mobile phone retailer's long-running and high-profile sponsorship of Big Brother, which it pulled out of earlier this year following the Celebrity Big Brother race row.
It includes sponsorship of all episodes, repeats and brand extensions, including The Xtra Factor on ITV2, as well as broadband, interactive, licensing and merchandising. Contestants from the show will also appear in Carphone Warehouse stores, and its customers will receive exclusive X Factor content.
Nokia dropped its sponsorship of The X Factor earlier this year after its marketing chief, Simon Lloyd, left the company.
The last series of The X Factor averaged 8.3 million viewers and a 37.5 per cent share of viewing. The series final peaked at 10.8 million viewers, a 45.7 per cent share of viewing.