Launch TeamViewer. Open its Menu (the hamburger button in the upper left corner), proceed to “Extras” – “Options” – “General”, and untick the box “Start TeamViewer with Windows”.
In Windows 10 or 8 press Ctrl+Shift+Esc, and open the “Startup” tab. Right-click on TeamViewer there and select “Disable”.
In Windows 7 or older open the Start menu, and type msconfig in the search box to open the System Configuration window. In Windows XP click Run in the Start menu to locate the search box.
In the System Configuration window open the Startup tab and uncheck TeamViewer’s box.