PostgreSQL - shared buffers expiration
Data never expires from shared buffers merely due to the passage of time. It will stay in shared buffers until it gets evicted to make room for some other data, until the PostgreSQL server is restarted, or until the object the data belongs to gets dropped (or truncated).  If the data is getting evicted, it is probably because other activity in the database needs to work with a different part of the data and needs to make room for it.

The amount of effective_cache_size which is more than shared_buffers is not dedicated to the DB in any formal sense.  It is an estimate only, it is not reserved or set aside.  That memory is subject to the OS kernel's eviction algorithm, not PostgreSQL's.