In a nut shell. Nine days make up what we call a Novena. It comes from the nine days in which the Apostles and Mary prayed in the Upper Room between Ascension Thursday and Pentecost Sunday for the out pouring of the Holy Spirit.
Over time, it became a tradition that many devotions would include nine (9) days of prayer.
The 40 days has it's roots in Scripture as well. Over and over we see the number 40.
- It rained for 40 days and 40 nights when the Lord destroyed man except for Noah and his family.
- The Israelites spent 40 years wandering in the desert.
- There is a small t tradition that Jesus fasted for 40 days when he went into the wilderness and was later tempted by Satan.
Forty (40) years is number associated with a generation but in the ancient Hebrew understanding, 40 weeks was the period of gestation from conception to birth. It's actually between 36 and 39 but in the Hebrew tradition it was 40.
So likewise on a spiritual level, when we see the number 40 symbolizing a period of gestation, or preparation, from the time when something is conceived until it is birthed.
It's just a tradition. Lent lasts 40 days — again, this is linked to the tradition that Jesus fasted for 40 days in preparation for His earthly ministry but not too many realize the meaning and why we repeatedly see 40 periods of time recurring in the Scriptures.