Unless you are using a shared subscription to the Apple Music service, you should not lose anything.
If you are accessing a shared Apple Music subscription, then you will need to get your own before leaving Family Sharing to avoid losing anything music.
Same applies to data in iCloud. If you are using shred iCloud+ storage, and you leave the group without getting your own iCloud+ subscription first, anything that exceeds 5GB may be deleted.
Apps purchased by other family members that are installed on your devices may not stop working, but may no longer be updatable,
Beyond that, synced music from a computer or your own purchased content and any other data will not affected by leaving.
Do note, leaving will not release any screen time restrictions in place. It will also not change anything else about how the devices work. It will allow you to use a payment method of your own to purchase items and media though.
Unless there’s a very specific reason for leaving, it usually does not do what people think it does.