The former Bayern Munich manager will replace Joachim Low, who will step down after EURO 2020 after 15 years in charge of the national team.
Flick stepped down as Bayern Munich manager towards the end of the 2020/2021 season and will be replaced by Julian Nagelsmann.
The 56-year-old won two Bundesliga trophies, Champions League, DFB-Pokal, UEFA Super Cup, FIFA Club World Cup and German Super Cup while in charge of the Bavarians.
"It all went surprisingly quickly for me with the signature, but I am very happy to be able to work as national coach from autumn onwards,” Flick told the DFB’s official website.
"The season has just ended and the two years at Bayern Munich were amazing. The team spirit and the attitude of the players were outstanding, and I'll take a lot with me that will continue to shape my work.
"I'm really looking forward to it because I can see the great quality of the players, especially the young players in Germany. That's why we have every reason to approach the upcoming tournaments with optimism, for example the European Championship at home in 2024.
"In addition, I know from experience that in Oliver Bierhoff I have a strong, trustworthy partner by my side who works behind the team, so that the team, we trainers and staff can get started without a long start-up time.
"I am also looking forward to contributing my ideas, and ideas beyond the national team to the academy and the other national teams.
"The important thing now is not what will happen in September - I will speak in detail in August - but the upcoming European Championship, for which I wish Jogi Low, Marcus Sorg, Andy Kopke and the team the greatest possible success. Jogi Low has more than deserved a big end to his career as national coach."