One must distinguish between a desire and morose pleasure. A desire can either be efficacious or conditional. An efficacious desire is a real intention to do something (e.g. I’m going to cut myself tomorrow), a conditional desire is a wish to do something without a real intention to (e.g. I would cut myself if it wouldn’t make me look crazy). Both of these are sinful in the same way as the actual act, since they both constitute a choice to do evil (assuming that the condition in a conditional desire does not take away the malice of the act).
OTOH, morose pleasure exists when one thinks of a sin and takes pleasure in it. Morose pleasure in sin is sinful, but its gravity is taken only from the object and the circumstances which motivate the taking of pleasure in it, not from all of the circumstances as they exist in the concrete (e.g. one who takes pleasure in the thought of fornicating with a married woman, not because she is married but simply because she is a woman, does not commit a distinct sin from one who takes pleasure in the thought of simple fornication).
It should be noted that morose pleasure in sin is not equivalent to pleasure in the thought of sin. One can often derive intellectual pleasure from thinking about a sin simply because it is interesting, this is not a sin of morose pleasure unless one enjoys the sin itself. Though of course certain sins (mainly sexual) tend to be difficult to think about without moving the passions, and therefore should not be thought about without good reason.
So, it is sinful to fantasize about cutting yourself, though it may or may not be gravely sinful, since causing
serious harm to yourself may not be precisely what motivates you. This is something you need to discuss with your confessor. Obviously, if these are simply intrusive thoughts that you do not voluntarily enjoy, then there is no sin.
Here is a reference, since others have posted incorrect information:
http://www.newadvent.org/cathen/14004b.htm (see the section “Internal sins”)