Praise be to Allah.
There are saheeh ahaadeeth that indicate that the Mahdi (peace be upon him) will appear at the end of time. He is one of the signs of the Hour. Among these ahaadeeth are the following:
1. Abu Saeed al-Khudri reported that the Messenger of Allah (Peace & Blessings of Allah be upon Him) said: "At the end of the time of my ummah, the Mahdi will appear. Allah will grant him rain, the earth will bring forth its fruits, he will give a lot of money, cattle will increase and the ummah will become great. He will rule for seven or eight years. (Mustadrak al-Haakim, 4/557-558; he said: this is a hadith whose isnaad is saheeh, although it was not reported by al-Bukhaari and Muslim. Al-Dhahabi agreed with him, and al-Albaani said: this is a saheeh sanad, and its men are thiqaat (trustworthy), Silsilat al-ahaadeeth al-saheehah, vol. 2, p. 336, hadith 771)
2. Ali (may Allah be pleased with him) said: "The Messenger of Allah (Peace & Blessings of Allah be upon Him) said: The Mahdi is one of us, a member of my family. Allah will guide him in a single night." (Musnad Ahmad, 2/58, hadith 645, edited by Ahmad al-Shaakir, who said: its isnaad is saheeh; Sunan Ibn Maajah, 2/1367. This hadith was also classed as saheeh by al-Albaani in Saheeh al-Jaami al-Sagheer, 6735). Ibn Katheer said: "This means that Allah will forgive him, grant him help, inspire him and guide him, when he was not like this before." (Al-Nihaayah, al-Fitan wal-Malaahim, 1/29; edited by Taha Zayni).
3. Abu Saeed al-Khudri said: "The Messenger of Allah (Peace & Blessings of Allah be upon Him) said: The Mahdi is of my lineage, with a high forehead and a long, thin, curved nose. He will fill the earth with fairness and justice as it was filled with oppression and injustice, and he will rule for seven years." (Sunan Abi Dawud, Kitaab al-Mahdi, 11/375, hadith 4265; Mustadrak al-Haakim, 4/557; he said: this is a saheeh hadith according to the conditions of Muslim, although it was not reported by al-Bukhaari and Muslim. See also Saheeh al-Jaami, 6736).
4. Umm Salamah said: "I heard the Messenger of Allah (Peace & Blessings of Allah be upon Him) say: The Mahdi is of my lineage and family, from the descendants of Faatimah." (Sunan Abu Dawud, 11/373; Sunan Ibn Maajah. 2/1368. Al-Albaani said that it is saheeh in Saheeh al-Jaami, 6734)
5. Jaabir (may Allah be pleased with him) said: "The Messenger of Allah (Peace & Blessings of Allah be upon Him) said: Eesaa ibn Maryam will descend, and their leader the Mahdi will say, "Come and lead us in prayer," but he will say, "No, one of them should lead them as an honour to this ummah from Allah."" The version narrated by Muslim says: " Then Eesaa ibn Maryam (Peace be upon him) will descend and their leader will say, Come and lead us in prayer, but he will say, No, some of you are leaders over others as an honour from Allah to this ummah." (Reported by Muslim, 225)
6. Abu Saeed al-Khudri (may Allah be pleased with him) said: "The Messenger of Allah (Peace & Blessings of Allah be upon Him) said: "He is one of us, behind whom Eesaa ibn Maryam will pray." (Reported by Abi Naeem in Akhbaar al-Mahdi. Al-Albaani said it is saheeh; see al-Jaami al-Sagheer, 5/219, hadith 5796).
7. Abdullaah ibn Masood reported that the Prophet (Peace & Blessings of Allah be upon Him) said: "The world will not come to an end until the Arabs are ruled by a man from my family whose name will be the same as mine." (Musnad Ahmad, 5/199, hadith 3573. Another version says: " whose name is the same as mine and whose fathers name is the same as my fathers." Sunan Abi Dawud, 11/370).
The ahaadeeth concerning the appearance of the Mahdi reach the level of Tawaatur in meaning (tawaatur refers to a hadith which was narrated by so many people through so many isnaads that it is inconceivable that they could all have agreed on a lie). The imaams and scholars of this ummah have stated this, and a few of their comments are quoted below:
1. Al-Haafiz Abul-Hasan al-Aabiri said: "The mutawaatir reports from the Prophet (Peace & Blessings of Allah be upon Him) describing the Mahdi are very many. They state that the Mahdi will be of his family, that he will rule for seven years, that he will fill the earth with justice, that Eesaa ibn Maryam will emerge and help him to kill the Dajjaal, and that he will lead this ummah in prayer and Eesaa will pray behind him."
2. Muhammad al-Barzanji said, in his book al-Ishaaah li Ashraat al-Saaah: "The major signs and the signs that will be immediately followed by the Hour: these signs are many, of which the Mahdi will be the first. Know that the ahaadeeth that have been narrated about him in various reports are numerous." He also said: "You know that the ahaadeeth which speak of the Mahdi, his appearance at the end of time, and his lineage and descent from the Prophet (Peace & Blessings of Allah be upon Him) via Faatimah reach the level of tawaatur in meaning, so there is no point in denying them."
3. Al-Allaamah Muhammad al-Safaareeni said: "There are so many reports which speak of the appearance of the Mahdi that they reach the level of tawaatur in meaning; they are very popular among the scholars of Sunnah and have become part of their faith." Then he quotes a number of ahaadeeth and reports about the appearance of the Mahdi and the names of the Sahaabah from whom they were narrated: "Many reports were narrated from the Sahaabah whose names were mentioned and others whose names were not mentioned, may Allah be pleased with them all, and from the Taabieen after them, all of which proves that this is definitive knowledge. Belief in the appearance of the Mahdi is obligatory, as it has been confirmed by the scholars and is listed among the beliefs of Ahl al-Sunnah wal-Jamaaah."
4. Al-Allaamah al-Mujtahid al-Shawkaani said: "The ahaadeeth that we have come across that speak of the awaited Mahdi reach the level of tawaatur, including fifty saheeh, hasan and daeef munjabar ahaadeeth. There are mutawaatir without a doubt; indeed they are more mutawaatir than others, according to all the standards of usool. There are also many reports from the Sahaabah that speak about the Mahdi and that reach the level of marfoo, so there is no room for individual opinions in such an issue."
5. Al-Allaamah al-Shaykh Siddeeq Hasan Khaan said: "Even though there are different versions of reports concerning the Mahdi, they are so many that they reach the level of tawaatur in meaning. They are to be found in al-Sunan and other books of Islam."
6. Al-Shaykh Muhammad ibn Jafar al-Kattaani said: "The conclusion is that the ahaadeeth narrated concerning the Mahdi are mutawaatir, as are the ahaadeeth concerning the Dajjaal and the descent of Eesaa ibn Maryam, upon whom be peace." (See Ashraat al-Saaah by Yoosuf ibn Abdullaah al-Waabil, pp. 195-203).
You should be aware that some liars have fabricated ahaadeeth about the Mahdi, and others have even claimed to be he, or that he belongs to a group other than Ahl al-Sunnah wal-Jamaaah. Some of these "false mahdis" have tried to deceive the slaves of Allah for some worldly gain and to distort the picture of Islaam. Some have started movements and revolutions and gathered those people and supporters whom they were able to deceive. Then they were destroyed, and their lies and falsehood were exposed. None of this affects the belief of Ahl al-Sunnah wal-Jamaaah in the Mahdi, upon whom be peace, and that he will undoubtedly appear and rule the earth in accordance with Islamic Shareeah.
And Allah knows best.