Dilating your eye causes the pupil to get bigger so the doctor can better check the Macula and optic nerve health. The picture below shows it best.
To properly dilate your eyes the doctor will put eye drops in your eyes. It can take 15-30 minutes for your pupils to fully dilate. Dilated eyes can last for 4-6 hours on average, though for some people it can last longer. (BrightFocus Foundation brightfocus.org)
How often should I get my eyes dilated?
It is recommended for children and people 40+ to get their eyes dilated every year. People with underlying health conditions such as diabetes and hypertension should also be dilated every year. Everyone else should be dilated every other year. If you're not sure if you should be dilated check with your eye doctor and they will let you know.