Open System Preferences / Displays and uncheck the corresponding option. It is usually set as default.
If you find yourself having to fiddle with this frequently, enable the Show displays in menu bar option, so a menulet pops up in the menubar and you don't have to go a-hunting for the System Preferences icon.
I think it depends a little on which OS you are running.
In Mountain Lion (10.8) the mirroring checkbox is in the "Arrangement" section, not to be confused with the "Mirroring options" checkbox, which refers to Airplay. Moreover, I believe the option to add the display prefs to the menubar is gone in ML, sadly.
Moreover, I believe the option to add the display prefs to the menubar is gone in ML, sadly.
Not altogether true. The option is still there, but Apple's obsession with streamlining the GUI now causes the icon to appear ONLY when an external display is plugged in. If you should desire to change screen-res for some reason, now you're screwed and have to dig down in SysPrefs.