The lees are the scummy bits that fall to the bottom of the fermenting container during fermentation.
As the yeast live, so do they die... and when they're done, their mortal remains fall to the bottom of the fermenter. These lees aren't dangerous, but if they're left too long (read a year or so) then they can impart a musty smell to the brew, and so it is good to rack the brew at least once during the fermentation process.
For beer, this occurs at bottling time.
For wine (especially with a long bulk ferment) it is a good idea to rack once in the middle of the ferment, as well as when bottling.