This is a very common problem. A can of WD-40 and 60 seconds will solve your problem.
The switch that turns the light on when the door opens is inside the door latch. Open your door and DROWN the latch in WD-40. Open and close the door a few times and repeat. This will clean the gunk off the switch and allow it to function.
BTW, the FAQ at the top of the page lists many other common problems.