The part of the eye that controls the amount of light entering is the iris.
The iris is the colored, ring-shaped structure surrounding the pupil. It acts like a camera diaphragm by changing the pupil’s diameter. In bright conditions, circular sphincter muscles contract the pupil, limiting light reaching the retina. In dim conditions, radial dilator muscles enlarge the pupil so more light can enter.
Strictly speaking, the pupil is the opening through which light passes; it is not a separate solid structure that actively adjusts itself. This distinction causes the most common confusion in this question. The iris controls the opening, while the lens changes shape to focus incoming light and the cornea provides much of the eye’s initial focusing power.
Human pupils can vary considerably in size, often from less than 2 millimeters in bright light to roughly 9 millimeters in darkness, although age and individual differences matter. The iris also gives the eye its visible color, determined largely by the amount and distribution of pigment in its tissues.