When I go to university for four years and study, e.g., law or medicine, do I earn an undergraduate degree? And do I have to go to university for another two years or so to get a graduate degree? Also, is it the same university then, or do I have to go somewhere else? And do you have to get a graduate degree? I’m really confused by the American academic system.
This flow chart, from the National Center for Education Statistics, summarizes it better than any explanation I can think of.
Everywhere you see an arrow represents a potential change of institutions, or (above the black line) a natural place to exit formal education if desired. In particular, most people who pursue graduate or professional study do so at a different institution than their undergraduate institution. (They are usually eligible to apply for a graduate program at their undergraduate institution, if it's offered, but don't receive any special preference over applicants from other institutions.)
I'd also note that in many fields, one can go from an undergraduate program directly into a PhD program, without having to get a masters first. In that case the PhD program normally takes more time (say about 5 years), and may or may not award a masters degree "en passant".
- When I’ve went to university for four years and studied, e.g. law or medicine, do I earn an undergraduate degree?
The first four years of university, in the U.S., generally result in an undergraduate degree. However, in the U.S., typically you can't study law or medicine at the undergraduate level.
- And do I have to go for another two years or so to university to get a graduate degree? Also is it the same university then, or do I have to go somewhere else?
Generally this is indeed done after an undergraduate program. The length of time varies greatly, depending on what course of study you choose. It is possible to earn a graduate degree at the same university where you earned your undergraduate degree, or at a different university.
In general, you have to apply for admission to graduate programs, and this is not guaranteed even if you are already an undergraduate at the same university.
- And do you have to get a graduate degree?
It depends on what you want to do. Many people seek employment right after their undergraduate studies and do not go on to graduate school. If you want to practice law or medicine in the US, then a graduate degree is necessary.
None of the answers have discussed this yet, so I'll mention that the 4-year undergraduate degree (a "Bachelor's of Science" or "Bachelor's of Arts" or perhaps "Bachelor's of Engineering") typically requires completion of a range of introductory "general education" courses as well as more specific requirements in a "major field of study." In comparison with most other countries, undergraduate degrees in the US (even in very technical fields) generally require a much broader range of course work.
For example, an undergraduate student majoring in computer science might be required to take about 25% of their courses in general education subjects including things like English, History, Psychology, etc. The CS major might include another 20% of courses in mathematics (e.g. calculus, combinatorics, probability, etc.) Another 40% of the major might be in specific computer science courses. The remaining courses would be "elective", allowing the student to take more computer science or branch out into other disciplines. Of these courses, only the "Computer Science" courses would be taught by Computer Science faculty. The general education courses and mathematics would be taught by faculty from those respective academic departments.
A 4-year degree (BS, BA, &c) just qualifies you to enter medical or law school. There are undergraduate pre-med and pre-law programs, but they're general degrees with concentration on areas needed in medical or law. You don't, AFAIK, actually have to take the pre-law or pre-med programs to get into medical or law schools.
A graduate degree requires extra study beyond the undergraduate degree, pretty much by definition. There's no fixed length. Two years is probably a minimum for a masters' degree, but you can take longer, if for instance you're doing it while working a regular job. (This is also true of undergrad degrees.)
You may or may not do graduate work at the same school that you did the undergraduate degree at. It really depends on your personal circumstances. If you are really interested in a particular field, and have financial support so you can continue directly to grad school, you'll typically try to get into the best program for that field. OTOH, if you are attached to the area you're living in, or need to work to finance education (and life), you might well stay at the same school. (As I did: I choose to live where I do for reasons unrelated to education, so I attend the local university.)
Also, in the US there's no need to go directly to grad school from undergrad. I got my MS about 15 years after the BS, and entered the PhD program some years after that. I also know several people who got undergrad degrees, became financially independent from jobs in industry, and went back to school to do grad work in fields that interested them.