When we are in an area with bright light, we can see clearly so our pupils are smaller to avoid damage to the eyes. In a dimly lit room, our pupils are wider because we need to focus our vision and there is not enough light to cause damage to the eyes.
It takes a while for our pupils to adjust to a larger size when we enter from a brightly lit area to a dimly lit room. Therefore, it takes some time to be able to see things in a dimly lit room.