The scholars differed as to the year in which Hajj was made obligatory. It was said that it was in 5 AH, or in 6 AH, or in 9 AH, or in 10 AH. The most likely to be correct are the last two suggestions, which is that it was made obligatory in 9 or 10 AH.
The evidence for that is the verse (interpretation of the meaning):
“And Hajj (pilgrimage to Makkah) to the House (Ka‘bah) is a duty that mankind owes to Allaah, those who can afford the expenses (for one’s conveyance, provision and residence)…”
[Aal ‘Imraan 3:97]
This verse states that Hajj is obligatory, and it was revealed in ‘aam al-wufood (the year of delegations) at the end of 9 AH, so Hajj became obligatory at the end of 9 AH.
See Zaad al-Ma’aad, 3/595
And Allaah knows best.
And Allaah is the Source of strength. May Allaah send blessings and peace upon His Prophet Muhammad and upon his family and companions.
See Fataawa al-Lajnah al-Daa’imah li’l-Buhooth al’Ilmiyyah wa’l-Ifta, 11/11.