My wife did this as a teenager. She talks about her experience to anyone who will listen.
She did this to relieve emotional pain, she could 'feel' the bad thoughts and experiences bleeding from her body when she cut. It was a piece of her life she had total control over, no one could take it away from her.
How did she stop? At her lowest point, after seeing doctors, taking pills, trying a lot of different things, she prayed intently and gave herself over to God. She has related this to imagining in your mind a garbage bag into which you put your problems...then you throw that mentally to God. It gave her the piece of mind to sleep at night.
I know that method doesn't help everyone, and I strongly encourage anyone experiencing this to seek help from trained medical doctors. Cutting may always be a part of her makeup, and she still has those thoughts during low periods....but she has found a coping mechanism in God, and through my support.