Sharepoint gathers usage and health data to database called WSS_Logging.

By Default retention period is 14 days.

If You want to make it lower, lets say 2 days use the below oneliner for it.

And then just a quick hint for releasing space from Sharepoint WSS_Logging database.

Use the query below to truncate db and free used space.