You can determine how many max connections your PostgreSQL server is configured for by using a simple SQL select query:
select name, setting from pg_settings where name = 'max_connections';
You will get an error message like this:
org.postgresql.util.PSQLException: FATAL: remaining connection slots are reserved for non-replication superuser
You can close some connections by stopping some applications, or even forcing it by restarting PostgreSQL.