Is there a scientific term for when you fall asleep because you can't handle something? I'm wondering if there is a scientific term that describes when you fall asleep or pass out after some traumatic event?

This effect happens when people witness something gruesome (a friend being killed, for instance), have some major upheaval in their life, or experience some other trauma (eg. a bad breakup, losing a job, etc.). When the mind can't cope it simply shuts off and they fall asleep or pass out. A decent example I just though of can be seen in the first Matrix movie (not the first place I would have thought of to look for an example) when Neo finds out about the matrix and promptly vomits and passes out for a few hours.

The closest term I'm aware of is a dissociative fugue or fugue state, though I'm unsure if that's related (possibly it's simply a more extreme version of the effect I tried to describe above).
I'm not completely sure, but you may be referring to Syncope, a medical term which describes events such as fainting or passing out which occurs upon low blood flow to the brain. As a result it can occur when under shock or trauma or a post-effect of stress. 

Obviously, one would expect the opposite to happen in half the events, such as after vomiting, however when you said


  have some major upheaval in their life, or experience some other trauma (e.g., a bad breakup, losing a job, etc.). When the mind can't cope it simply shuts off and they fall asleep or pass out.


I realised you may be relating to someone feeling a depressed, in which case lowering of blood pressure is possible and thus he or she could suffer from syncope.

In all honesty it is simply a technical term for fainting, and is more commonly used for people who suffer a disorder which will cause them to faint often.