The adverb dimly is good for describing the way a room is lit when there's only a small amount of light. A dimly lit dining room might have just one flickering candle, for example.
Adverbs describe the way something is done, and in the case of dimly, it's almost always used to describe the way something is lit — just barely. A dimly illuminated library wouldn't be a great idea, because it would be so difficult to read, but a dimly lit movie theater makes perfect sense. Dimly comes from the adjective dim, whose root is the Old English dimm, "dark or obscure," from Germanic origins.