Short Answer
Technically, you may perform Hajj on behalf of someone deceased. It is prohibited to do that if you have not performed your own required Hajj first. You may not perform it on behalf of someone living if they are able to go.
Reason for Asking the Question
Some Muslims are concerned that a family member of theirs may not perform Hajj during their lifetime, although it is an obligation. Out of love for them, they hope to fulfill the requirement on their behalf.
What the Sunnah Said
Ibn Abbas said “The wife of Sinan bin Salamah Al-Juhani ordered that the question be put to the Messenger of Allah about her mother who had died and had not performed Hajj: would it be good enough if she were to perform Hajj on behalf of her mother? He said: ‘Yes. If her mother owed a debt and she paid it off, would that not be good? Let her perform Hajj on behalf of her mother.”’ (Nasa’i #2633)
Advice
In some regions, this has become a business where relatives hire someone to perform Hajj for their deceased relatives. This is a very unhealthy trend and was not something done by the Messenger of Allah or his Companions.
Version 0.25
Shaykh Mustafa Umar