If you change from the speakers to the headphones in Windows, you have to set the whole thing again in TeamSpeak. TeamSpeak does not automatically adjust to the Windows settings. There is no direct solution to this, but with a hotkey for a second playback profile the device can be switched much faster.
Under Tools > Options > Playback you can find the playback profiles with their respective settings. With the small "plus" you can add a profile.
Under Tools > Options > Hotkeys you can now set a hotkey to switch between the playback profiles. Next:
+ Add > Show Advanced Actions > Playback Profile > Toggle Playback Profile
Now we see the two playback profiles we just created: Headphones and Speakers. Click one of them, which does not matter. Click No Hotkey Assigned and select the desired hotkey to toggle. Confirm with OK.
This way, the TS3 sound can be switched from speakers to headphones and vice versa with one touch of a button.