All by itself, fainting is not life-threatening. However, sudden cardiac arrest looks a lot like fainting and requires immediate treatment. Whenever you see someone pass out, make sure the victim is breathing; if not, call 911 and begin CPR.
Once someone faints, get the victim comfortably lying flat. You can elevate the legs to help blood flow return to the brain, but it is generally not necessary.
Treatment after that depends on the cause of fainting. If this is the first time this person has ever fainted, I recommend calling 911. There are some dangerous conditions that can cause fainting and will require an evaluation by medical professionals to determine how to proceed.
If the victim has a history of fainting, watch the breathing and give him a couple of minutes to wake up. If the victim doesn't wake up within three minutes of lying flat, call 911.