That would be a type of factitious disorder, perhaps Munchausen syndrome if he or she is doing it for attention. Try doing an Internet search for these terms for me information.
Note: I wasnt saying that all people who hurt themselves do it for attention, I was just saying that those that do do it for attention are said to have Munchausen syndrome.