Depending on context, Hijrah can either specifically refer to the migration of the Prophet (pbuh) and his companions from Makkah to Madinah, which took place in the twelfth year of his mission (622 CE) and which marks the beginning of the Muslim calendar. Or it can generally apply to any Muslim who is made to move from a land because they can't practice their faith to a land where they can. 
It is stated in Al-Lisaan: "Al-Hajar (migrating) is the opposite of Al-Wasl (arriving and establishing oneself). The word Hijrah and Hujrah (both) mean leaving from one land to another land. The ‘Muhaajireen’ - those that migrated with the Prophet (sallAllaahu 'alayhi wa sallam) - is a derivative of this word. And every person that abandons his place of dwelling transferring to another group of people to live amongst them, he has made Hijrah. The Muhaajireen are called this name because they left their lands and dwelling places, which they grew up in, for the sake of Allaah. And they proceeded until they entered a land, in which they had no family or possessions, which was the case when they migrated to Madeenah. So every individual that separates from his land, whether he lives in the rural areas (i.e. a Bedouin) or in the urban areas, then he is considered a Muhaajir. And the noun form derived from that is Hijrah." Lisaan-ul-‘Arab of Ibn Al-Mandhoor (rahimahullaah). 
After Prophet Muhammad (May Allah honour Him and grant Him peace) had preached publicly for more than a decade, the opposition to him reached such a high pitch that, fearful for their safety, he sent some of his adherents to Ethiopia, where the Christian ruler extended protection to them, the memory of which has been cherished by Muslims ever since. But in Makkah the persecution worsened. Prophet Muhammad's (May Allah honour Him and grant Him peace) followers were harassed, abused, and even tortured. At last, therefore, Muhammad (May Allah honour Him and grant Him peace) sent seventy of his followers off to the northern town of Yathrib, which was later renamed as Madina ("The City"). Later, in the early fall of 622 CE, He learned of a plot to murder Him and, with His closest friend, Abu Bakr al-Siddiq, set off to join the emigrants.
In Makkah the plotters arrived at Prophet Muhammad's (May Allah honour Him and grant Him peace) home to find that his cousin, 'Ali had taken his place in bed. Enraged, the Makkans set a price on Muhammad's (May Allah honour Him and grant Him peace) head and set off in pursuit. Muhammad (May Allah honour Him and grant Him peace) and Abu Bakr ®, however, had taken refuge in a cave. Muhammad (May Allah honour Him and grant Him peace) and Abu Bakr® went on to Madina, where they were joyously welcomed by a throng of Madinans as well as the Makkans who had gone ahead to prepare the way. Ar–raheeq al maqtoom:p:128
This was the Hijrah - anglicized as Hegira from which the Muslim era is dated. In fact, the Hijrah was not a flight but a carefully planned migration which marks not only a break in history - the beginning of the Islamic era- but also, for Muhammad (May Allah honour Him and grant Him peace) and the Muslims, a new way of life. Henceforth, the organizational principle of the community was not to be mere blood kinship, but the greater brotherhood of all Muslims. The men who accompanied Muhammad (May Allah honour Him and grant Him peace) on the Hijrah were called the Muhajirun - "those that made the Hijrah" or the "Emigrants" - while those in Madina who became Muslims were called the Ansar or "Helpers."
The people of Ta’'if ordered their children to throw rocks and stones at prophet Muhammad (peace be upon him) to drive them out of the city. The rocks that were thrown at him by the children caused him to bleed seriously, so much that his feet became stuck to his shoes by the drying blood. Ar–raheeq al maqtoom:p:100
Order from Allah:
In 622 (CE) Prophet Muhammad (May Allah honour Him and grant Him peace) received an order from Allah (Glory be to Him) to migrate to Madina due to the plot of the people of Makkah. He and his companion Abu Bakr left Makkah miraculously and started their journey in south instead of North (Madina is situated in north of Makkah)
Stay in Cave Saur:
He stayed in cave “Saur” for three days to hide from the people of Makkah. Asma, a daughter of Abu bakr provided them food for three days. She used to come with the herd and graze them. Later on Prophet Muhammad (May Allah honour Him and grant Him peace) took the way of Madina with his companion.
Welcoming in Madina:
Ansaars rushed to pay their respects to the Prophet of Allah (peace be upon him); they requested him to enter the city, saying, Ride on! Ye two are safe and we shall obey you! 
At the time of Second Caliph, Umar, the Islamic calendar came into existence. The consensus of the Companions made Hijrah of the Prophet Muhammad (May Allah honour Him and Grant Him peace) as the start of Islamic Calendar.