Nostr: How long do relays keep posts?

There is no universal retention period.

Short answer

There is no universal retention period. A relay can set its own storage limits and deletion policies, and another relay may hold a copy for a different period. Nostr events are not automatically preserved forever just because they were signed. For material you care about, publish to dependable relays and keep an independent archive of the event data and media.

Sources

NIP-01: Basic protocol, NIP-11: Relay metadata.