In the Exodus story, the Israelites wander in the wilderness for forty years before reaching the Promised Land.
The forty-year period follows the Israelites' report about Canaan and the people's refusal to enter the land. In Numbers, the duration is linked to the forty days spent exploring Canaan: a year is assigned for each day. The older generation is condemned to die in the wilderness, while the next generation will enter the land.
The number is not presented as a simple travel estimate. The route from Egypt to Canaan could be much shorter, but the biblical account makes the extended wilderness period a consequence of rebellion and a period of testing. Moses remains the leader during this era, though he himself does not enter Canaan.
Joshua eventually leads the Israelites across the Jordan River into the land. Forty is also a recurring symbolic period in the Bible, but the Exodus tradition specifically connects these forty years with Israel's wilderness generation and its preparation for settlement.