What happens with my iCloud data after leaving family sharing?
This Apple Support document answers your query:


Share an iCloud storage plan with your family



  If your family stops sharing storage or you leave Family Sharing
  
  If you leave a family that shares an iCloud storage plan and you're using more than 5GB of storage, you have 28 days to buy your own plan.
  
  If you choose not to buy your own plan and the content that you’re storing in iCloud exceeds your available storage, new photos and videos won’t upload to iCloud Photos, files will no longer upload in iCloud Drive, and your iOS devices will stop backing up.


i.e., you will have 28 days of grace period to get a separate plan and keep access to your data.