In Jewish and Christian tradition, the number 40 has symbolic meaning. A period of 40 days or years, more than being a literal measurement, represents a long time and a period of preparation or testing. When 40 days or 40 years have passed, the appropriate period or the “right amount of time” has been completed in preparation for the working of God’s grace.
Recall the 40 days and 40 nights of rain during the flood in Genesis 7, the 40 years that the Israelites wandered in the desert after their exodus from Egypt, and the 40 days that Jesus spent in the desert before beginning his public ministry in the gospels of Matthew, Mark, and Luke. Lent lasts 40 days so that we will spend the “right amount of time” in this period of penance and preparation before Easter. The number 40 is symbolic, not a specific count of the days in Lent.