Laurenz's answer is mostly correct, but is technically wrong on one important point. There is a limit, which is at the end of unsigned 64-bit address space. This means you have around 18 exabytes of life-time write capacity on a single PostgreSQL database. After that point, I assume that PostgreSQL would be unable to write log segments after and effectively stop working. We can call that limit "the end of history."
Before you reach that point, you could logically replicate the database to another cluster and start over. However to my knowledge nobody has ever even come close to that limit. The limit is currently well out of reach of all current users of Postgres, but at some point I assume this could change and then I assume PostgreSQL will come up with a workaround.