Use Multiple Displays With Your Mac - Apple Support

When you set up an extended desktop with an additional display in OS X  Mavericks or later:

Related Use Multiple Displays With Your Mac - Apple Support