The concept of Imam is common to all school of thoughts of Islam. But it is only the word that is common and there is difference in authority and acession of Imam in all major School of though within Islam.
First let see how the Sunni school of thought have this concept. In a very basic way the one who leads the prayers in a in collective prayer in mosque is called Imam.
What about Imam Shafi, Imam Malik, Imam Hanifa and others then? All these were scholar who have greatly contributed to the fiqa research and its compilation. So one more concept of Imam is one who is scholar of Fiqa.
Then we have Imam Muslim, Imam Bukhari and others. These Imams have collected the sayings of Prophet Muhammad(PBUH) so the second concept of imam is the scholars who have collected the Hadith of Prophet Muhammad(PBUH).
During the Muslim rule there were many scholar in medical, astronomy and other fields. They were also called Imam tib(Imam of medical knowledge)
In summary we say that in Sonny Islam one who is specialized in any field be it the interpretation of Holy Quran, Hadith or any secular knowledge they are called imams.
The concept of Imam in the Shia school of thought is entirely different. The accession of Imamt is a divine process. Hazrat Ali (A.S) became the first Imam after the death of Prophet Muhammad(PBUH). They say the Prophet had declared him the Imam during his last cermon of Ghadir khum. He(PBUH) said ‘ Mann Kuntum Mawla, Fahaza Ali o Mawla’ . To whom I was the mawla, Ali is their Mawla.
The Shia branched out with passage of time. After death of Imam Jafar Sadiq(A.S) the Shias split into two major branches. Those who accepted the Imamt of Imam ismail called the Ismaili and those who accepted Imam Kazim called themselved drozi. This branching out continued and by the twelevth Imam the majr popultion of Shia seperted out with the concept of Imam mehdi being gone from this physical world and he will be back at right time. These have became the second largest sects of Islam after Sunii sect.
The other part of Shia who beleive that Imam Mehdi died and his Son Qayom became the 13th Imam and these are the third largest by population and are called Shia Imami Ismaili. The imamt has continued till today and it will remain till the last mankind on this planet and H.H prince Karim Aga Khan IV is the 49th Imam of this sect.