Its called Aero Snap. I also find it a not so good feature and had the same problem as you. Not to worry. 
Control Panel > Ease of Access > click make my mouse easier to use and then put a tick in the box next to prevent windows from being automatically arranged when move to the edge of screen and it will turn Aero Snap off.