Apple Support:

You can capture your entire screen or just a selected portion of it. The screenshot is automatically saved to your desktop.