Prophet's Tribe, Ahlal Bayt (Family) & Righteous Successors
Imam Mahdi (alaihi salaam) is not another prophet or a messenger who is going to bring new teachings of Islam or modify the existing teachings in any way. He is a follower of Prophet Muhammad ﷺ, his descendant and will rule the Muslims as confirmed from various prophetic ahadith such as: “Mahdi will be from my descendants who will fight (to establish) my sunnah as I fought according to the divine revelation.” In the ahadith we are informed that Imam Mahdi (a.s) will establish Islam according to the Prophet's sunnah (way) which means he will follow the way of the Prophet ﷺ when ruling by the Quran. Imam Mahdi (a.s) is only mentioned in the hadith literature with no reference to him in the Quran. Yet his importance is clear for us in Islam and that is mainly due to three very important reasons.
Firstly, he will arrive at the time when Muslims are leaderless and cannot face and overcome their economic and political difficulties caused by their enemies. After his arrival, Allah ﷻ will strengthen him to overcome his rival leaders among Muslims who are siding with their enemies and eventually he will destroy their plans. He will end political and economic exploitation of the Muslims and help regain back their occupied territories so they can live in peace and in accordance to Allah’s guidance i.e. His book and prophet’s sunnah. He will end injustice and oppression that fills the Muslim region, as said in a prophetic hadith: “Mahdi will be from my family, his nose will be prominent and his forehead will be bright and shining. He will fill the earth with justice and equity, just as (before it) it had been filled with tyranny and transgression.”
He is the sign of the final hour for Muslims and his arrival is linked with other major signs that have yet to occur. Signs of the hour in Islam stand as proof for believers further strengthening their faith while warning the disbelievers of punishment in the hereafter. Please see some of the signs of the hour listed in my post End times prophecies - Minor signs. His arrival will be a sign that the Day of Judgment is close and Muslims will have stronger faith and be more concerned with the hereafter rather than making this temporary world their primary concern. His arrival will help Muslims learn that other major signs such as the arrival of Isa ibn Maryam (Jesus son of Mary) (a.s) as told in the Quran is also imminent. Therefore, those who will be the army and supporters of Imam will have the courage to face the disbelievers causing destruction in the Muslim region. The mission of Isa ibn Maryam (a.s) is to kill the Al Masih Al Dajjal (False Messiah) i.e. Anti-Christ who would be a major source for all the corruption and oppression throughout the world especially Muslim lands such as middle east and surrounding area. Dajjal is also one of the major signs of the hour as per prophetic hadith. Therefore, Imam Mahdi’s arrival will indicate the upcoming of these two major signs of the hour. The arrival of Imam Mahdi (a.s) will also prepare Muslims for a greater mission of defeating the Dajjal at the hands of Isa (a.s), and to bring peace to the entire region. Various ahadith mention Imam Mahdi and Isa ibn Maryam (a.s) will be together such as: “When Mahdi will appear Isa ibn Maryam will descend and it will seem as though water is dropping from his hair. At that time Mahdi, addressing him, will say ‘please come forward and lead the people in prayer.’ Prophet Isa will say ‘the iqamah (call to prayer) was said for you; therefore, you will lead the prayer.’ Accordingly, Isa will offer this prayer behind a man from my family (Mahdi).”
The term "mahdi" means the "the guided one" and this is the Imam's title but not his real name. His real name will be Muhammad ibn Abdullah as told by the Prophet ﷺ: "If only one day of this world remained. Allah would lengthen that day, till He raised up in it a man who belongs to me or to my family whose father's name is the same as my father's..." According to another version: "The world will not pass away before the Arabs are ruled by a man of my family whose name will be the same as mine."  The Prophet ﷺ also warned us that every upcoming age will be worse than the previous and humankind will continue to be in such state until the Day of Judgment. Due to spread of corruption, the religious thought of the Muslims will also be impacted especially when he said that in the last hour: “knowledge shall be raised up, ignorance shall be rampant.” Due to lack of knowledge Islamic teachings will be misinterpreted causing confusions and eventually misleading and cause Muslims to deviate. The ignorance and the confusions about the religious teachings is also what Imam Mahdi (a.s) will fight against. There are revivers of faith appearing in every age among the scholars of Islam for the past fifteen hundred years such as Shah Waliullah of sixteenth century, Shaikh Ahmad Sirhindi of fourteenth century, Ibn Taymiyyah of the twelfth century and Imam Ghazzali of ninth century etc. A prophetic hadith teaches: “Allah will raise for this community (Muslims) at the end of every hundred years the one who will renovate its religion for it.” Imam Mahdi is one of the final revivers of faith before the Day of Judgment who will also remove prevalent confusions through preaching and writing. And Allah ﷻ knows best.
The place of his arrival - when & where?
His arrival as stated explicitly in the hadith literature will be in present day Saudi Arabia in the cities of Makkah and Madinah. The time of his arrival such as date and year is something we have not been told by the Prophet ﷺ and any speculation considering the exact time will be of no benefit unless someone has sure knowledge from authentic texts. However, we can only estimate if we are closer to his time or not by observing other major and minor signs and that is it. The hadith that mentions about his arrival also mentions incidents that will surround his appearance: “Disagreement will occur at the death of a caliph (a political ruler) and a man of the people of Madinah will come flying forth to Makkah. Some of the people of Makkah will come to him, bring him out against his will and swear allegiance to him between the corner and the Maqam. An expeditionary force will then be sent against him from Syria but will be swallowed up in the desert between Makkah and Madinah. When the people see that, the eminent saints of Syria and the best people of Iraq will come to him and swear allegiance to him between the Corner and the Maqam.”
This hadith tells us that he will be given allegiance in Makkah. The fact that he will be taken out and forcibly given allegiance proves that he does not will to take leadership of the Muslims. This is what distinguishes a false claimant from an actual Mahdi. In the history of Islam, there have been several Mahdi claimants and all of them were false because they did not fulfill description given in the hadith. One of the contrary reason is also that they first declared themselves as Mahdi and then forcibly secured allegiance of people around them. What makes an actual Imam Mahdi (a.s) distinct from a pretender is that he will be forced by people to become the leader while he would be doing his best to avoid it. In the case of actual Mahdi, the people will forcibly give their pledge to him. In addition to the major sign of Jesus (alaihi salaam) and Dajjal, another one related to appearance of Imam Mahdi is the landslide in Arabian Peninsula (Hejaz). Hudhaifa bin Usaid (r.a) reported that the Prophet ﷺ was in an apartment and we were beneath that and he said to us: “What are you discussing about?" We said: "We are discussing about the Last Hour." Thereupon he said: "The Last Hour would not come until the ten signs appear: dajjal, descent of Jesus (alaihi salaam), land-sliding in the east, and land-sliding in the west, and land-sliding in the peninsula of Arabia…” This major sign confirms news in the previously shared hadith about the “expeditionary force that will be swallowed up in the desert between Makkah and Madinah.” This swallowing might be due to the land sliding or an earthquake in Arabian Peninsula.
The land sliding in Arabian Peninsula is one of the ten major signs as related to us by Prophet Muhammad ﷺ which will indicate the arrival of Imam Mahdi (a.s) as well as inform the believers that the hour is even nearer. This is so they may prepare themselves for the hereafter by becoming steadfast in their religious teachings rather than being engrossed in worldly pleasures like rest of humanity.
Ibn Hammad narrated it in Al-Fitan and Imam Suyuti in al-Hawi lil-fatawa - Tahir-ul-Qadri, Dr Muhammad. 2003. The Awaited Imaam Mahdi . Lahore: Minhaj-ul-Quran Publications - Tahir-ul-Qadri 2003
 Hakim in Al-mustadrak recorded it as Sahih - Tahir-ul-Qadri, Dr Muhammad. 2003. The Awaited Imaam Mahdi . Lahore: Minhaj-ul-Quran Publications - Tahir-ul-Qadri 2003
 Related by Suyuti in al-Hawi lil-fatawa (2:81) - Tahir-ul-Qadri, Dr Muhammad. 2003. The Awaited Imaam Mahdi . Lahore: Minhaj-ul-Quran Publications - Tahir-ul-Qadri 2003
 Sunan Abi Dawud - Book 37, Hadith 4269 - Sunnah.com
 Jami at-Tirmidhi 2205 – Sunnah.com
 Sunan Abi Dawud 4291 – Sunnah.com
 Also called Maqaam e Ibraahim ie. Place where Ibrahim (alaihi salaam) stood and prayed in Makkah.
 Sunan Abi Dawud 4286 – Sunnah.com
 Sahih Muslim 2901 b – Sunnah.com