Genesis tells us that the deluge lasted forty days and 40 nights (7.12), and, according to Mark 1:9-13, Jesus fasted in the desert for forty days. St. Paul in his writings to the Christians in Corinth, recalls when he received 40 lashes by the Jews (2 Cor. 11.26).
Abraham implored God to save Sodom if there he would find at least 40 righteous people (but had come down to less than ten in the end), and when saved from Esau he offered 40 cows in sacrifice. In Egypt, Joseph took 40 days to embalm the body of his father. Moses was on Mount Sinai for 40 days and 40 nights, and when the tabernacle was built it took 40 silver bases to stand on. The explorers of the land of Canaan arriving to the Promised Land: it took them 40 days, but in return they had 40 years of punishment. Judge Abdon had 40 children, and the Philistine persevered for 40 days, according to Samuel (1 Sam. 17.14).
Even the great prophet Elijah remained on Mount Horeb for 40 days and 40 nights and Jonah preached repentance to the inhabitants of Nineveh for 40 days.
(The art above is Holbein's artistic vision of The Purification).