There are no specific number of matches, it all depends on your group and continent. A team could fail to qualify after losing 1 match or could qualify even after losing as much as 3. The format for the World Cup Qualification is quite different depending on your continent. For instance, the Qatar 2022 Word Cup will feature just 5 African countries but would feature as much as 13 teams from Europe.
To qualify automatically from Europe, you have to finish at the top of your group. If a team fails to qualify but finishes on the second spot, that team moves to the play offs. In total, 12 teams advance to the play off with the extra 2 coming from the Uefa Nations League best. Only three teams from Europe qualify for the World cup through play offs. In Africa, the best teams from each group still play with 5 second placed teams to determine the 5 slots. In South America, the top 4 teams qualify while the 5th team is determined from play offs.