Target SDK:
You set the highest Target SDK that you've tested your app to be working with. More importantly, when your app uses a feature available in a newer (higher) SDK, you set the target >= SDK feature you're using.
e.g. If you plan to use a Animation which is only available in SDK 21, you must set Target SDK >= 21.
Compile SDK:
http://developer.android.com/guide/topics/manifest/uses-sdk-element.html
The compileSdkVersion property specifies the compilation target. This describes the version of the compiler for your application.
Also note the guide for the compilation in the documentation: "By default, only the compilation target, and the version of the build-tools are needed. This is done with the compileSdkVersion and buildtoolsVersion properties. The compilation target is the same as the target property in the project.properties file of the old build system. This new property can either be assigned a int (the api level) or a string with the same value as the previous target property."