This question already has an answer here:
A window manager's task is to do window placement/layout (tiling, overlapping, resizing, ...), add decorations (min/max/close buttons, window menu, pretty title bar, ...), deal with input focus policies (focus follow mouse for instance), and that's about it.
When people refer to desktop environments, they usually mean a window manager plus a set of base applications (taskbar (with widgets), application launch menu, system configuration panel, text editor and basic utilities, etc...).
So a window manager is one part of a desktop environment.
A Desktop Environment provides other things like drag-and-drop, hotkeys, a clipboard and other accoutrements we normally associate with a "modern" GUI operating system.
The Window Manager is (usually) a major part of the Desktop Environment. It is responsible for the placement and appearance of windows and often for special "eye candy" effects and compositing.