Can underlying psychological factors contribute to self-harming behaviors?

Is my habit of digging my nails into my skin and punching objects considered self-harm?