The mahdi is a person who will emerge amongst the Muslim and be their leader. He will rule over us with justice. He will be alive and ruling over the Muslims when Isa (AS) (i.e. Jesus) returns.
He is a minor sign of the Hour (Day of Judgement).
Some relevant hadiths:
Abu Sa’eed al-Khudri reported that the Messenger of Allaah (Peace & Blessings of Allaah be upon Him) said: "
At the end of the time of my ummah, the Mahdi will appear. Allaah 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."
‘Ali (may Allaah be pleased with him) said: "The Messenger of Allaah (Peace & Blessings of Allaah be upon Him) said: ‘
The Mahdi is one of us, a member of my family. Allaah will guide him in a single night.’"
Abu Sa’eed al-Khudri said: "The Messenger of Allaah (Peace & Blessings of Allaah 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.’"
Umm Salamah said: "I heard the Messenger of Allaah (Peace & Blessings of Allaah be upon Him) say: ‘
The Mahdi is of my lineage and family, from the descendants of Faatimah.’"
Jaabir (may Allaah be pleased with him) said: "The Messenger of Allaah (Peace & Blessings of Allaah 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 Allaah."’" 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 Allaah to this ummah.’"
Abu Sa’eed al-Khudri (may Allaah be pleased with him) said: "The Messenger of Allaah (Peace & Blessings of Allaah be upon Him) said: "
He is one of us, behind whom ‘Eesaa ibn Maryam will pray."
‘Abdullaah ibn Mas’ood reported that the Prophet (Peace & Blessings of Allaah 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."
All the above hadiths are authentic, I removed the referenes because they are too long, they can be found at the following link.
http://www.islam-qa.com/index.php?ref=1252&ln=eng