Mahdi is one of the most famous names of Imam. Considering the reason for this naming for Imam, Imam Bagher said: Qaem of the family of Mohammad is named so because he guides people toward those things which were unknown to them. He reveals the true Torah and other books of previous prophets.
Regarding this Imam Sadeq also says: he is called Mahdi because he guides people towards the thing that they have lost.
Qaem is one of the titles for Imam Mahdi; imam Reza considers the reason for this naming: Hazrat Saheb-Al-Amr is called Qaem because he will truly rise up. Sheikh sadok cites in Kamal-Al-Din: saqr Ibn Dalf said:
Someday I asked Imam Mohammad Taqi: o son of the messenger of Allah , why son of Imam Askari PBUH is called Qaem? His Honor answered: because he revives the true Imamat (pontificate) after it has been forgotten and after most people refusing it.
In prospect (Montazar)
It has been narrated from Imam Javad that Imam Mahdi is called Montazar because The Absence for him is very long. The sincere and true friends regardless of the length of this absence would anticipate his Appearance, but the doubters would doubt and renounce him.
It has been also said that His Honor is always waiting till he is given the permission by God for rising up and appearing. Then he would eradicate oppression from the earth and fill it with justice.
In some narratives and prayers Imam Asr is called Hojjah or Hojjatollah. There has been different reasoning for this naming. For example it has been said: using Imam, God the Almighty gives ultimatum to his slaves and gives answer to all their questions and doubts.
So that there would remain no excuse for any one in disobeying God. Some also have said: Imam Zaman is Hojjatollah in this sense that God’s governance over His subjects is realized by His Honor.