On SLR cameras, the optical path is connected to the viewfinder. Even while a picture is being taken and the mirror is up, blocking the viewfinder path, it's possible the seal/gasket between the mirror and focusing screen will let some light through. It's a very small amount of light, and usually not noticeable.
However, when taking long-exposure or bulb-mode photos, your face probably isn't covering the viewfinder. Coupled with the longer exposure time, the light leak in the mirror seal accumulates, affecting the captured photo.
For example, in this related question, Pink/Purple lines on my photos while shooting long exposure?, the light leak shows up as purplish and green streaks across the wide dimension of the camera's sensor:

This is very typical of viewfinder light leaks in SLR cameras, if the viewfinder isn't covered.
Note that viewfinder light leaks don't happen when using cameras with electronic viewfinders (such as mirrorless interchangeable lens cameras) or separate viewfinders not in the optical path (most older point-and-shoots, and rangefinders).