When Windows 7 was released, it introduced a new feature called Snap—which allows users to easily resize windows when they are dragged to the edges of the screen. Depending on where the window is dragged, it expands vertically, takes up the entire screen, or arranges itself side-by-side with another open window.
If you find this feature more annoying than helpful, you can disable it in the “Ease of Access Center” in the Windows Control Panel. Click on the “Change how your mouse works” link, scroll down to the “Make it easier to manage windows” section, then check the box labeled “Prevent windows from being automatically arranged when moved to the edge of the screen.”