Generally speaking, when you go to the eye doctor for a general exam you are usually seeing an optometrist. Their concentration is the eye and structures related to the eye. An optometrist goes to school for four years and then enters optometry school, where they will receive their Doctor of Optometry degree (O.D.-Oculis Doctor).
An ophthalmologist, on the other hand, concentrates on diseases of the eye. They are specialists in anatomy and function of the eye and perform surgeries. They go to school for 4 years, attend medical school, complete residency and internship, and then attend a school for post graduate studies in ophthalmology. Upon completion of school they will hold a medical degree (M.D.) or doctor of osteopathy (D.O.).
An optometrist is usually a Masters' level prepared health care professional that evaluates the eyes. He may examine the eyes and fit you for glasses. An opthalmologist is a medical doctor that specializes in diseases of the eye and surrounding structures, like blood vessels and nerves. Most opthalmologist's are also surgeons that can perform surgery on the eyes, like cataract surgery. Both individuals are important in the delivery of healthcare regarding your eyes and vision.
The basic difference is that an optometrist has less education than an ophthalmologist and the optometrist also is not able to do nearly as much as the other one (so as not to type that word too often...). So it's almost like an optometrist is a sort of junior ophthalmologist.
An optometrist only goes to school for four years after college and is then a Doctor of Optometry (not an M.D.). An ophthalmologist goes to 4 years of medical school, one year of internship, and then at least three years of "residency" which is on the job training at a hospital. An opthalmologist is an M.D. and is able to do more things than an optometrist.
You can see more details at the link below.
An ophthalmologist is a fully qualified medical practitioner specialising in the field of eyes. They are trained and authorised for diagnosing and treating all medical problems relating to eyes including treatment of eve related diseases and prescribing spectacles or contact lenses for correcting vision.
In contrast, optometrists are non-medical professionals licensed to test vision and prescribe spectacles and contact lenses to correct vision.
The people who make and sell spectacles as per prescription of ophthalmologists and optometrists are called opticians.