Egypt beat South Africa, the only other nation to bid, by 16 votes to one with one abstention at a Caf executive committee vote in Senegal.
Original host nation Cameroon was stripped of staging duties in November because of slow preparations.
Egypt, has just six months to prepare for the expanded 24-team finals, which kick off in June.
It will be the fifth time Egypt has hosted the tournament, the most recent was in 2006.
Caf has since offered Cameroon the chance to stage the finals in two years’ time, which has meant that the original hosts for both the 2021 and 2023 finals have been asked to delay their tournaments.
Caf had originally planned to name the new hosts on Wednesday 9 January.
Ivory Coast, which was set to host the 2021, has protested against the decision at the Court of Arbitration for Sport.
Guinea’s football federation announced on Monday that it has agreed to move its staging of the Nations Cup from 2023 to 2025.
Tuesday’s announcement took place in the Senegalese capital Dakar, which will host Caf’s annual awards ceremony later in the day.
Egypt’s Mohamed Salah is looking to retain his title as he takes on Gabon’s Pierre-Emerick Aubameyang and Senegal’s Sadio Mane for the African Player of the Year award.