بسم الله الرحمن الرحيم
والصلاة والسلام على نبيه الامين
وعلى اهل بيته الطيبين الطاهرين
Many people imagine that the Prophet Muhammad's (sall Allahu alaihi wasallam) kept long hair but would tuck his sidelocks, or the hair at the front sides of his blessed head, behind his ears. This is indeed the prevalent style among religious Sunni Muslims who keep longish hair.
Sayyidina Anas bin Malik (radi Allahu anhu) narrates about the Prophet Muhammad (sall Allahu alaihi wasallam):
كَانَ يَضْرِبُ شَعَرُهُ مَنْكِبَيْهِ
“that his hair would touch his shoulders”
(Sahih al-Bukhari)
Keeping long, shoulder length hair out of imitation and love for the Prophet (sall Allahu alaihi wasallam) is tragically a Sunnah that is by and large no longer practised by Muslim men today. Instead they tend to prefer shaved or extremely short hair, usually out of imitation of non-Muslims and evil celebrities. Those Muslim men who do keep long hair, wanting to practise the blessed Sunnah, tend to tuck their hair behind their ears. However, Imam al-Baihaqi (rahimahullah) explains:
وَكَانَ رُبَّمَا جَعَلَهُ غَدَائِرَ تَخْرُجُ الْأُذُنُ الْيُمْنَى مِنْ بَيْنَ غَدِيرَتَيْنِ تَكْتَنِفَانِهَا وَتَخْرُجُ الْأُذُنُ الْيُسْرَى مِنْ بَيْنِ غَدِيرَتَيْنِ تَكْتَنِفَانِهَا يَنْظُرُ مَنْ كَانَ يَتَأَمَّلُهُمَا مِنْ بَيْنِ تِلْكَ الْغَدَائِرِ كَأَنَّهُمَا تُوقَدُ الْكَوَاكِبُ الدُّرِّيَّةُ بَيْنَ سَوَادِ شَعَرِهِ
“[The Messenger], peace and blessings be upon him, would sometimes make his hair into four braids, the right ear coming out from between two braids that were surrounding it, and the left ear coming out from between two braids which were surrounding it. And the two ears would come forth with their whiteness from between these braids as if they were two brilliant stars lit up from amidst the blackness of his hair.” (Dala'il an-Nubuwwah; v.1, p.300):
Therefore, the Sunnah for a man is to grow out his hair shoulder length, and separate the hair into four parts, two parts left hanging in front of the ears and two parts left hanging behind the ears, whether the hair is braided or unbraided.