In 1889 French physician, Francois Henri Hallopeau saw a young male patient who had pulled out patches of his own hair.  In his case report Hallopeau gave it the name trichotillomania.

The word is a combination of three Greek words:

trich means hair

tillo means pull

mania has a number of meanings including frenzy, madness, excessive activity

The word mania is a rather unfortunate term.  People with Trich are by no means mad or crazy. 

The Bible

Ezra 9:3 (Old Testament)

When I heard this, I tore my tunic and cloak, pulled hair from my head and beard and sat down appalled.

Isaiah 50 v6

I offered my back to those who beat me, my cheeks to those who pulled out my beard; I did not hide my face from mocking and spitting.

Luke 12: 6-8

"Are not five sparrows sold for two pennies? And not one of them is forgotten before God. Why, even the hairs of your head are all numbered. Fear not; you are of more value than many sparrows."

Shakespeare

Much Ado About Nothing (Play, 1599)
Act 2, Scene 3

Leonato:
O, she tore the letter into a thousand halfpence, rail'd at herself that she should be so immodest to write to one that she knew would flout her. 'I measure him,' says she, 'by my own spirit; for I should flout him if he writ to me. Yea, though I love him, I should.'
Claudio:
Then down upon her knees she falls, weeps, sobs, beats her heart, tears her hair, prays, curses 'O sweet Benedick! God give me patience!'
Leonato:
She doth indeed; my daughter says so. And the ecstasy hath so much overborne her that my daughter is sometime afeard she will do a desperate outrage to herself. It is very true.

The Tragedy Of Romeo And Juliet (Play, 1595)
Act 3, Scene 3

Friar:
Let me dispute with thee of thy estate.
Romeo:
Thou canst not speak of that thou dost not feel.
Wert thou as young as I, Juliet thy love,
An hour but married, Tybalt murdered,
Doting like me, and like me banished,
Then mightst thou speak, then mightst thou tear thy hair,
And fall upon the ground, as I do now,
Taking the measure of an unmade grave.

Other Shakespeare references to hair pulling:

The Tragedy Of Titus Andronicus (Play, 1594)
Act 3, Scene 1

The Rape of Lucrece (Poem, 1594)
line 1120

 The Life and Death of King John (Play, 1597)
Act 3, Scene 4

Homer's The Illiad (c.750 BC) (Lang et al. 1945, pp. 165-166)

"... even so oft in his breast groaned Agamemnon, from the very deep of his heart, and his spirits trembled with him. And whensoever he looked toward the Trojan plain, he marvelled at the many fires that blazed in front of Illios, and at the sound of flutes and pipes, and the noise of men; but whensoever to the ships he glanced and to the host of Achaians, then rent he many a clean lock forth from his head, to Zeus that is above, and gently moaned his noble heart."

"The Discourses" by Epictetus (101 AD), Book 3, Chapter 1

 "Indeed I think that the men who pluck out their hairs do what they do without knowing what they do."

"The Discourses" by Epictetus (101 AD), Book 3, Chapter 22

"But neither was Agamemnon happy, though he was a better man than Sardanapalus and Nero; but while others are snoring what is he doing? 'Much from his head he tore his rooted hair.' And what does he say himself? 'I am perplexed,' he says, 'and disturbed I am,' and 'my heart out of my bosom is leaping.'"

Chinese Proverb

You cannot prevent the birds of sorrow from flying over your head, but you can prevent them from building nests in your hair.

In India there is an age-old expression which translates as, "I got so frustrated, I plucked the hair of my head."