9:2
Go ye, then, for four months, backwards and forwards, (as ye will), throughout the land, but know ye that ye cannot frustrate Allah (by your falsehood) but that Allah will cover with shame those who reject Him.
According to the commentary, the verse granted the disbelievers and idolaters of Makkah a period of four months as a respite. During this time they were permitted either to leave the Arabian Peninsula or to accept Islam. This ruling applied particularly to those who were bound by treaties that had no specified duration or whose agreements would expire in less than four months. The passage further emphasizes that such individuals were warned that they could not escape the decree of God, as the humiliation of those who persisted in disbelief would ultimately occur according to divine judgment.
References:
Ahmad, Israr. (2012). Bayan ul Quran.