Here's a very brief overview of the involuntary holds in California. You can google Lanterman-Petris-Short Act for more information. The numbers below are commonly thrown around and refer to the Welfare and Institution Codes sections.
5150 - 72 hour hold for Danger to Others (DTO), Danger to Self (DTS), or Grave Disability (GD). Very low threshold for filing this one (can be filed by social workers, police officers, etc.). The patient technically has the right to appeal, but functionally doesn't as the appeal process would take longer than the actual hold. This one takes a few minutes to fill out. It must be accompanied by an advisement which similarly takes a few minutes.
5250 - 14 day hold for DTO, DTS, or GD. This one takes a few minutes as well, typically longer as it will potentially be viewed by a judge. This is filed prior to the expiration of the 5150. It does not need to be the same grounds as the 5150, though it typically is. It almost always includes GD (it's hard to convince judges that you need to hold someone for up to 17 days due strictly to violence risk). Patients have a right to appeal this one. Patients are either brought to court or the judge comes and sets up "court" at a hospital unit or other such site. The physician (in academic programs, this is typically done by residents) represents the hospital filing the 5250 and the patient has an advocate (patient advocate and/or lawyer). The hearing lasts 10-30 minutes depending on complexity. I usually have interns watch me do one, then I have them do them on their patients from then on.
Riese - For patients who are not taking medications, a separate filing called a Riese is done. This is a longer filing that takes about 15 minutes to fill out. The purpose of this hearing is to allow the hospital to give non-emergent psychotropic medications involuntarily. This one entails documenting what medications were offered and when they were refused and a basic evaluation that demonstrates that the patient lacks capacity to make this decision. Riese hearings are typically held in conjunction with 5250 hearings.
5260 - Much more rare. 14 day holds for DTS after 5250 expiration.
5300 - Much more rare. 180 day holds for DTO after 5250 expiration.
5270 - More commonly referred to as Temporary Conservatorship or T-Con for GD. 30 day to 6 months. An MD makes an application to the Public Guardian's office indicating that the patient does not have capacity due to mental illness to make certain decisions for themselves. A judge reviews the application and makes the determination. The patient has the right to appeal. These are more involved. I often have residents do the paperwork on this with me but you need to be a licensed physician to appear in court when there is the hearing (which is typically in court, not on the unit).
5350 - More commonly referred to as Permanent Conservatorship or P-Con for GD. Good for 1 year, thought the patient may appeal it every 6 months. Similar to the T-Con in process and requirements.