You can save a lot of space – I had over 2GB of these once upon a time. (Apple has been working on Messages in iCloud since 2017, but the feature isn’t available yet).
That’s the shortest time you can keep Messages, but losing them in this way will save you space.
If your messages have no legal significance, open Settings>Messages and in Keep Messages choose 30-days. It’s also good practice to go through your installed apps regularly to get rid of the ones you don’t actually use. If you’re down on space, you should delete some apps – the iPad Storage page helpfully supplies you with a few hints to help you rescue more space. How much space do you have available on your iPad? To find out, tap Settings>General>iPad Storage.