Two ways:

postgres=# \l
postgres=# select * from pg_database;