how install postgres 9.6 and a corresponding PostGIS
Postgres.app

The easiest way to use Postgres with PostGIS on a Mac is Postgres.app. This is a special build of Postgres wrapped to act like a normal Mac app, including launch with a double-click. The latest versions come with PostGIS built in.

Installer by EnterpriseDB.com

If you want to a run a Postgres installation on your Mac in a manner similar to that on other Unix-like platforms (BSD, Linux, etc.), I suggest downloading a graphical installer app provided by the EnterpriseDB.com company as a courtesy to the community. Follow the macOS links from the Postgres site to the EDB site’s download page. Note that EnterpriseDB makes their own editions of Postgres with added value, in addition to providing the "plain" Postgres. 

Source code

The hard-core developer or DBA will download the Postgres source code and compile it herself. 

I've not had the nerve to try that. You may be motivated to do so either for fun or because you want to tweak some of the internal Postgres settings that are modifiable only during compilation and not at runtime. 

FYI: The core team creating Postgres provides only source code. Any app or installer you may obtain is the product of additional persons’ work.