How do I let the users delete a data from a database automatically?

I would like a user to “set” when the data will be deleted from the database or atleast hide it. Is that doable? I saw examples that automatically delete it but I would like the user to be able to set it when will it be deleted.