If you really need to keep around more data than can fit in a single server, the PostgreSQL wiki has some documentation to that effect [1], with PostgreSQL-XL [2] and Citus [3] being specific examples of systems which can shard a Postgres database across multiple nodes.
A more DIY alternative to the above is to leverage PostgreSQL's support for foreign data wrappers [4] to include results from other servers. The cool thing about this approach is that the other servers don't even have to be PostgreSQL servers; hell, they don't even have to be SQL, nor do they even have to be servers.
The great thing about most/all of these solutions is that you don't have to worry about them upfront; you can roll them out when you're closer to actually hitting practical/theoretical limits. No need to prematurely optimize :)
[1]: https://wiki.postgresql.org/wiki/Replication,_Clustering,_an...
[2]: https://www.postgres-xl.org/overview/