Quite often, the pointer turns into a spinning beach ball while your Mac has a think. Occasionally it stays that way. First, try pressing COMMAND + PERIOD (full stop) to cancel whatever process is running. If that has no effect, switch to Finder or another application using ALT+ TAB, and carry on working. If you wait, the app will finish what it's doing and give you its full attention.
If you're convinced the app isn't going to recover, force it to quit using COMMAND+ Q. Rarely it refuses to die, or its windows may dissappear while its dock icon retains its open indicator. Restarting your Mac will get rid of it, but could give a message saying the app failed to quit. Hold down the power button to force shutdown.
You can also use a Unix command for this: run Terminal - found in Utilities within the Applications folder - and type sudo shutdown -h. Close other apps first to avoid losing data.