DO they automatically get deleted from the iPhone hardware or iCloud? The phone is not activated with cellular connection only wifi, does this make a difference.
If you delete a message it will be deleted permanently.
Messages save in the memory. So once you deleted a message or any kind of file, it will be deleted permanently. But there are softwares to recover them and it is possible sometimes. The explanation of that is not suitable here since you have asked a simple question.
If you have made a backup using iCloud and if the messages you were deleted, existed in that particular moment when that iCloud backup was made, then messages are still in the iCloud. iCloud keeps backups until you run out of iCloud storage. So you can restore those messages from iCloud anytime you want (by restoring entire backup) if those were backed up properly. If you don't need them in iCloud, you have to delete that backup.
Here's what Apple has to say about iMessages (which are managed through iCloud).
We use end-to-end encryption to protect your iMessage and FaceTime conversations across all your devices. With watchOS and iOS, your messages are encrypted on your device so that they can’t be accessed without your passcode. We designed iMessage and FaceTime so that there’s no way for us to decrypt your data when it’s in transit between devices.
You can find that linked here.
Hardware components and log files on your iPhone: Electronic memory most commonly volatile meaning that it will be wiped during a reboot. Flash Storage is how your device remembers it's operating system, app data etc and that may contain logs with message content but it is most certainly encrypted and anything that apple can support (iMessage / Blue Texts) are encrypted and are incapable of being traced or read by anyone but your devices and the other user's devices.
Regular Text Messages: Phone companies have policies about what they keep and for what duration, there is unlikely anyway to tell your phone company to stop recording text messages or networking data. This is largely due to government laws that assist police in tracking criminals, however these laws will be different depending on your region of the world. If your username suggests Vancouver Island, Canada, I would contact one of your service providers (Rogers, Bell/Virgin Mobile, Telus etc).