I come from iOS to the Mac and want to make a simple utility that lives in the menu bar at the top right.
Some "menu bar apps" open a "window" like a speech bubble. The app is in the "window". When you click outside the "window" the "window" closes.
Here is a good looking example from Crashlytics Mac app:
Found this example project but I want to learn more about it and what it is called officially.
The OS X Human Interface Guidelines call them menu bar extras.