Hair should be clean, well-groomed and neatly kept. Said 'Ata ibn Yasar, "Once a man came before the Prophet (peace be upon him) with his hair and beard unkempt. The Prophet (peace be upon him) made some gestures as though ordering the man to comb his hair. He did so, and upon his return, the Prophet (peace be upon him) remarked, 'Is this not better than one of you coming with dishevelled hair, looking like a devil?'" (reported by Malik in Al-Muwatta)
The Prophet himself (may the peace and blessings of Allah be upon him) used to take great care when grooming his hair. 'Aisha reported: "The Messenger of Allah (peace be upon him) loved to start from the right-hand side for performing ablution, for combing (the hair) and wearing shoes." (Muslim)
Women should be mindful of arranging their hair before their husbands enter their houses. Once the Prophet (peace be upon him) was on an expedition with some Companions. Upon their return to Medina when they were about to go back to their houses, the Prophet (peace be upon him) said, "Wait so that we may enter by the night so that the woman with dishevelled hair may comb it and the woman whose husband has been away may get herself clean." (agreed upon)
It is a hated thing in Islam to go to extremes in styling the hair. Consider the following hadeeth:
Abu Hurairah narrated that the Messenger of Allah (peace be upon him) said, "I will not be a witness for two types of people who are destined for the Fire: people with whips, like the tails of cows, who beat the people (i.e., tyrannical rulers who are the enemies of their own people), and women who, although clothed, are yet naked, seducing and being seduced, their hair styled like the tilted humps of camels. These will not enter the Garden, nor will its fragrance even reach them, although its fragrance reaches a very great distance." (Muslim)