There is no such option to delete automatically after 24hours however you can explore custom scripts or tasks to delete the sample data, as per Microsoft the subscription expires after 90 days and data is deleted.
Subscription is renewable based on valid developer activity. If you're using your subscription for development, it will be renewed every 3 months and will last indefinitely. You can find the expiration date, along with your subscription name, on your Microsoft 365 Developer Program dashboard.
Please don't forget to upvote and Accept as answer if the reply is helpful
If this answer helped you please mark it as "Verified" so other users can reference it.