My ex-husband registered my iPhone and I have found out he has been using iCloud to check up on my every move (the iPhone he got me is connected to his iCloud account). Will he have been able to read all of my personal text messages exchanged through the iPhone? And is there anything I can do to prevent him from reading my messages in the future?
Will he be able to read all of my iPhone's text messages?
Yes. If he has an iPad, Mac, or iPhone hooked up to the same iCloud account as you use on your iPhone, then all of the texts you receive will notify him too, and he can see your sent texts and send some of his own too. He can also (if he's crafty) restore a new iPhone from an iCloud backup of your iPhone and thus copy data from all of your apps.
Do I have any rights?
You can certainly sign out of his iCloud account (go to the Settings app on your iPhone, scroll down and tap iCloud, then scroll down again and tap
Sign Out). Then, create your own new iCloud account (go to https://icloud.com in a web browser). Be very sure to set it up with a strong, original password you've never used before, and ensure that your ex does not have access to the email account you set up iCloud with. Then as an added security precaution, you should set up Two-Factor Authentication on your iCloud account which ensures that anyone signing on to your account would need physical access to your iPhone. For a guide on setting up Two-Factor Authentication, see https://support.apple.com/en-us/HT204915.
Now your ex will not be able to see your iCloud data.
Tip from user Alexis: do not set the recovery questions to something your ex would be able to guess. Instead, make up false answers and store it somewhere local (not anywhere in the cloud!!) like on a flash drive, an offline note, or even a piece of paper.