Use spinners to show users that something is happening based on an action they took. They also offer reassurance that the product is isn't stuck.
Spinners specifically help visualise a small (generally less than 10 seconds) yet unspecified wait time. If you do know the wait time and the wait time is likely to be longer than a few seconds, use a progress bar instead.
Spinners are used for circumstances such as:
Whenever you can, include a phrase with the spinner that tells user why they're waiting/what is happening. For example: Uploading image, Checking connection.