Set key expiry
Change how long a key remains valid, using official tools on your computer.
Expiry does not replace revocation. If a key is lost or compromised, revoke it. Expiry is a planned end date you can extend later if you still have the private key.
In GnuPG, the official quick command is:
gpg --quick-set-expire FINGERPRINT 1yYou can also use a date, or never. The same official manual documents the expire command inside gpg --edit-key.
In Kleopatra, use the Certificates menu together with the official handbook, then publish the updated public key if the key was already on a server.