When Was Hajj Made Compulsory?
Question

In which year following the Hijrah was Hajj made obligatory?
Praise be to Allah.When was Hajj made compulsory?
The correct view is that Hajj was made obligatory in the ninth year AH and Allah did not make it obligatory before that. This is because making it obligatory before that would not have been wise, as Quraysh prevented the Messenger (peace and blessings of Allah be upon him) from doing ‘Umrah. So it was possible and likely that they would also prevent him from doing Hajj. Before the conquest, Makkah was a land of disbelief, but it was liberated from disbelief after the conquest, after which enjoining Hajj upon the people was in accordance with wisdom. 
The evidence that Hajj was made obligatory in the ninth year is that the verse which enjoins Hajj appears in Surat Al 'Imran, where Allah says (interpretation of the meaning): “And Hajj (pilgrimage to Makkah) to the House (Ka‘bah) is a duty that mankind owes to Allah, those who can afford the expenses (for one’s conveyance, provision and residence)”  [Al ‘Imran 3:97]. And this part of this surah was revealed in the year of delegations (‘am al-wufud). 
Why didn’t the Prophet perform Hajj in 9 AH?
If it is said: Why did the Prophet (peace and blessings of Allah be upon him) not perform Hajj straight away in 9 AH when you are saying that Hajj must be done immediately as soon as it becomes obligatory? The answer is that he did not do Hajj then for several reasons: 

The large number of delegations who came to him in that year. Hence the ninth year AH was called the year of delegations. Undoubtedly receiving the Muslims who came to the Messenger (peace and blessings of Allah be upon him) to learn about their religion was something important, and indeed we should say that it was obligatory for the Messenger (peace and blessings of Allah be upon him), to convey the message to the people. 
In the ninth year, it was expected that the polytheists would perform Hajj – as indeed happened – and the Prophet (peace and blessings of Allah be upon him) wanted to delay it so that his Hajj would be only for the Muslims, and this is what happened. “In the ninth year, it was announced that after that year no polytheist was to perform Hajj, and no one was to circumambulate the Ka’bah naked.” (Agreed upon). 

The people used to circumambulate the Ka’bah naked, except those who could find clothing to borrow from Quraysh to perform tawaf in. But people other than Quraysh could not circumambulate it in their own clothes so they circumambulated it naked.” (Al-Sharh al-Mumti’, 7/14, 15) 
It says in Fatawa al-Lajnah al-Daimah (11/10): 
“The scholars differed concerning the year in which Hajj was made obligatory. It was said that it was 5 AH, or 6 AH, or 9 AH, or 10 AH. The most likely to be correct are the last two opinions, which is that it was made obligatory in 9 or 10 AH. And Allah knows best. 
And Allah is the Source of strength. May Allah send blessings and peace upon our Prophet Muhammad and his family and Companions.” (Standing Committee for Academic Research and Issuing Fatwas) 
And Allah knows best.