I was able to remotely access Postgres database on a different PC.
This video was very helpful.
https://www.youtube.com/watch?v=4IhfbxhoAn8
Basically you need to open the windows firewall (or create an exception for the port) and change the line
host all all 127.0.0.1/32 scram-sha-256
to
host all all 0.0.0.0/0 scram-sha-256 in the pg_hba.conf file.