Men, as far as Islam is concerned, should generally keep their trousers a little bit above the ankles whether they are in prayer or outside it, and it may be lengthened till the ankles, but below the ankles is forbidden if it implies showing-off; if not, lengthening in this case is just makruh (blameworthy), especially if it drags on filth.
Clarifying the Islamic ruling regarding keeping trousers below the ankles, and the Islam’s stance on that, the eminent Muslim scholar, Sheikh Yusuf Al-Qaradawi, states the following: “The Prophet (peace and blessings be upon him) said: “Eat and drink (from what is lawful), wear garments, and give charity without extravagance or showing-off.” (Reported by Al-Bukhari)
In this hadith the center point is ‘extravagance and showing-off’. Thus, one should avoid both things in all affairs. This is based on many Prophetic sayings narrated in this respect. One of them is: “Wearing whatever is below the ankles may drive one to Hell”. (Narrated by Al-Bukhari)
the theme of this hadith is applied to both the hands and the legs and covers all of what is worn on them, like trousers, garments, etc.
Al-Bukhari and Muslim also reported that the Prophet (peace and blessings be upon him) said: “Whoever drags his garment on the ground, as a show-off attitude, will never behold Allah on Doomsday”. Thereupon, Abu Bakr (may Allah be pleased with him) said to the Prophet: “O Allah’s Messenger! My garment is somehow long but I manage to keep it from dragging.” The Prophet (peace and blessings be upon him) said: “You are not known for showing-off”. Thus, showing-off is a form of arrogance and vainglory.
Therefore, men should to keep their trousers a little bit above the ankles, and it may be lengthened till the ankles, but below the ankles is forbidden if it implies showing-off; if not, lengthening in this case is just makruh (blameworthy), especially if it drags on filth.”