Numbers 13:25

And they returned from searching of the land after forty days.

Cross-reference

Numbers 14:33 shows the consequence: the 40 days of spying become 40 years of wandering for the people's faithlessness.

Numbers 14:34 explicitly links the 40 days of spying to 40 years of punishment, a day for a year.