There are many aayat in the quran and many books written by ahlussunnah about Imam Mahdi as
1. Holy Qur’an 21: 105
— وَلَقَدْ كَتَبْنَا فِي الزَّبُورِ مِن بَعْدِ الذِّكْرِ أَنَّ الْأَرْضَ يَرِثُهَا عِبَادِيَ الصَّالِحُونَ
— Before this We wrote in the Psalms, after the Message (given to Moses): My servants, the righteous, shall inherit the earth.
— – Ardh is the earth and the verse concerns people who have faith in general.
— – The virtuous members of the Community are being referred to here; it is said that, at the End of Time, the Umma of the Prophet under the leadership of MAHDI will conquer the earth and its unbelievers, and will rule it.
2. Holy Qur’an 24: 55
— وَعَدَ اللَّهُ الَّذِينَ آمَنُوا مِنكُمْ وَعَمِلُوا الصَّالِحَاتِ لَيَسْتَخْلِفَنَّهُم فِي الْأَرْضِ كَمَا اسْتَخْلَفَ الَّذِينَ مِن قَبْلِهِمْ وَلَيُمَكِّنَنَّ لَهُمْ دِينَهُمُ الَّذِي ارْتَضَى لَهُمْ وَلَيُبَدِّلَنَّهُم مِّن بَعْدِ خَوْفِهِمْ أَمْنًا يَعْبُدُونَنِي لَا يُشْرِكُونَ بِي شَيْئًا وَمَن كَفَرَ بَعْدَ ذَلِكَ فَأُوْلَئِكَ هُمُ الْفَاسِقُونَ
— Allah has promised, to those among you who believe and work righteous deeds, that He will, of a surety, grant them in the land, inheritance (of power), as He granted it to those before them; that He will establish in authority their religion, the one which He has chosen for them; and that He will change (their state), after the fear in which they (lived), to one of security and peace: ‘They will worship Me (alone) and not associate aught with Me. ‘If any do reject Faith after this, they are rebellious and wicked.
— From the sayings of the Imams of the Ahl al-Bayt, it is reported that it concerns the Mahdi from the Prophet’s descendants. The fourth Imam, Ali ibn Husain a.s., once recited this verse and said: “By God, these people are our Shi’ites about whom God will accomplish all the promises he made in this verse by the hands of a man from among us, who is the Mahdi of this Community.”
3) Holy Qur’an 9: 33
— هُوَ الَّذِي أَرْسَلَ رَسُولَهُ بِالْهُدَى وَدِينِ الْحَقِّ لِيُظْهِرَهُ عَلَى الدِّينِ كُلِّهِ وَلَوْ كَرِهَ الْمُشْرِكُونَ
— It is He Who hath sent His Messenger with guidance and the Religion of Truth, to proclaim it over all religion, even though the Pagans may detest (it).
— Shaykh Tabarsi reports from Dhahhak that the expression “liyuzhirahu ‘ala al-din kullihi” (“to proclaim it over all religion”) refers to the time of the descent of ‘Isa ibn Maryam on the earth when the followers of all religions will become Muslims.
— He then reports a tradition from Imam Baqir (fifth Imam) that this event will occur during the time of the reappearance of the Mahdi from the progeny of the Prophet when there will be no one left on the earth who did not accept the message of the Prophet Muhammad.
Mahdism in Sunni Islam
The Sunnis view the Mahdi as the successor of prophet Mohammad(s.a.w.a). The Mahdi is expected to arrive to rule the world and to reestablish righteousness.
The Mahdi is frequently mentioned in Sunni hadith as establishing the caliphate. Among Sunnis, some believe the Mahdi will be an ordinary man.
The Prophet of Islam, Muhammad (s.a.w.a) said:
The world will not come to an end until the Arabs are ruled by a man from my family whose name is the same as mine and whose father’s name is the same as my father’s. (Sunan e Abi Dawood 11:370)