What is the difference between psychiatrists and psychologists?

A psychiatrist is a medical doctor, while a psychologist is not.
A psychologist has a doctorate of philosophy degree (Ph.D.) in psychology (or a Psy-D). This is a graduate degree that typically takes 4-7 years to complete. (Some psychologists have a master’s degree, which takes less time than a Ph.D.) Psychologists have completed undergraduate college or university, taken the GRE (a standardized exam), and completed years of graduate school in psychology.
A psychiatrist is a medical doctor who has graduated from medical school (usually 4 years) and completed a residency (most residencies are at least 3 years long) in psychiatry. The field of psychiatry includes the psychology world, as well as the medical world. Technically, most psychiatrists have at least 6 months of training in either internal medicine or pediatrics, including some neurology experience.
A psychiatrist, in the United States, usually goes to an undergraduate university or college first, before medical school. Then takes the MCAT (a standardized exam) and applies to Medical School. Some medical doctors are DOs (Doctor of Osteopathy). They go to Osteopathic Medical School. MD means Doctor of Medicine and they go to a traditional Medical School. There are subtle differences between the two, but in practice, they function the same in our medical world (in the United States). Both MDs and DOs apply for the same residencies and fellowships and medical doctor jobs. In California, there is a different state board governing the standards of practice for each one.
Psychiatrists prescribe medications. Psychiatrists have the medical training to evaluate the other medical diseases that may present as mental problems or may be contributing to mental disorders. As the song goes: “The foot bone’s connected to the leg bone. The leg bone’s connected to the knee bone; the knee bone’s connected to the thigh bone…” All the body parts are connected and interconnected. So having medical training is important in evaluating how the two worlds of the psychiatric and the medical may be manifesting, mimicking each other, and affecting each other. For example, medications for a medical problem may have effects on the brain, and vice versa.
Psychologists study the mind and the brain too. They study development and psychological theories and concepts, just like psychiatrists do. Many psychologists do research. They learn a lot about psychological tests, in part because the tests are used for their research. Many of them study psychotherapy, sometimes with a subspecialty in a specific type of psychotherapy. They spend years in graduate school and study a lot of different aspects of the world of the brain and mind. They also have hours of hands-on treatment (psychotherapy) experience. Many are wonderful therapists and researchers.
Remember that psychologists are not medical doctors. They have not gone through medical school nor had any hands-on training in the medical treatment of patients. Many have had a class on medications, but that is very different than prescribing medications for patients. They are not allowed to prescribe medications in most states of the United States including California.