Depersonalization is a type of dissociation (so is derealization). I prefer to lump all such experiences under the umbrella term of dissociation, because whatever it feels like, it is an escape from a normal state of consciousness.
Jon G. Allen has an excellent description of the range of dissociation in his book Coping with Trauma. It is summarized in an article about trauma available on the Menninger Clinic's Web site, and I am including a lengthy excerpt here. I made more paragraph breaks for clarification.
"Dissociation is an automatic, self-protective alteration of consciousness in the face of overwhelming stress, a form of mental flight. Although dissociation mentally removes you from painful experience, it can undermine your functioning when it develops into a habitual way of coping with anxiety or stress.
"The most common form of dissociation is dissociative detachment: feeling disconnected from yourself or the outer world, for example, in a trance-like or dream-like state. Dissociative detachment can be contrasted with alert consciousness, being flexibly aware of what’s going on outside of you as well as inside of you. Mild detachment involves being very absorbed in something—a movie, a book, or a daydream. Being absorbed in one activity, you’re detached from all else (e.g., you might not even hear your name being called). Such absorption is healthy and necessary for creative activity. Problematic dissociative detachment involves feelings of unreality.
"Depersonalization involves feelings of unreality regarding your sense of self. You may feel you’re on autopilot, you’re an actor in a play, you’re disconnected from your body, or you’re observing yourself from outside of your body.
Derealization involves a sense that the outer world is not real. You may feel as if other persons are actors in a play or as if you’re looking at the world through a tunnel.
Extreme detachment involves feeling as if you’re gone, in the blackness, or in a void—completely unaware. Some persons can sit and stare for hours, not being aware of time passing. When you’re very detached, you may have trouble remembering what you’ve said or done; you have not encoded it well into memory and therefore cannot retrieve it.
"Another form of dissociation is compartmentalization. Some persons develop dissociative amnesia for frightening or stressful events; they’re blocked from consciousness but, with time and effort, can be remembered. Some persons experience fugues during which they lose their sense of identity and memory for their past and travel to another place—again, recovering their memory and sense of identity with time and effort.
Dissociative identity disorder involves changes in sense of identity and engaging in uncharacteristic behavior (e.g., childlike or aggressive behavior) coupled with amnesia for behavior in dissociative states. Treatment of dissociative compartmentalization involves helping the individual to have the stressful memories and emotions in mind rather than having to compartmentalize them by amnesia.
"PTSD and dissociation overlap, and some clinicians consider flashbacks to be a form of dissociation—they involve altered consciousness and detachment from current reality. Thus grounding techniques are helpful in coping with dissociation and PTSD symptoms. These techniques (e.g., holding ice, squeezing an object, walking around in the fresh air, talking to someone) draw your attention to current reality by heightening your sensory awareness."