For how long postgres will keep alive connection after changing credentials? I have an app running Ruby on Rails, standard nothing fancy at all. Today when I was changing password in Postgresql I spot that app is still running with old credentials. This gives me time to rolling restart app with new db credentials. Open connections still work, because was authenticated with old credentials. How long Postgres will keep those connection active? I assume that there must be some time after client must re-authenticate. Where I can find more about it? Some setting? Tried to find something on https://www.postgresql.org/docs/9.5/static/runtime-config-connection.html but still don't know how it works in details.
A PostgreSQL instance will keep a client connection up and running until the connection either reaches a specified client timeout or the client (application) closes the connection. 

A change of password has no effects on existing connections and will only affect new connections.

There is no mechanism that constantly checks if the connection is still "password valid". A client connection is a one time authentication and if it was valid at the time of authentication will keep on being valid until closed.