When somebody is in the middle of rapid firing you some text messages and they become too much for you to bear, you have a few options on your iPhone. You can simply leave the conversation, if it's an iMessage group chat with four or more participants, or you can put the whole message thread on silent, which applies to everyone, no matter if it's iMessage, SMS, MMS, or a group conversation.
To hide alerts on your iPhone, make sure you're running iOS 8 or higher, then just open the conversation in Messages that you want to enable the do-not-disturb option for. This process is pretty much exactly the same across iOS versions, but the options are called something slightly different, as you'll see.
Either tap on the "i" button or the "Details" button in the top right, depending on your iOS version. On the next screen, toggle on either "Hide Alerts" or "Do Not Disturb" for the chat. And that's all there is to it.
There will be a new crescent moon icon next to the person or group on the homepage of the Messages app to remind you that Do Not Disturb is turned on for them. Whenever a new message comes in, that moon icon will be highlighted blue, as seen below.
Now, whenever you get an incoming message from the person (or persons) in the iMessage or SMS/MMS thread, you will receive zero notifications on your lock screen, as banner alerts, or in the Notifications View (or Recent Notifications, as it's called in iOS 11). However, you will still receive "Badge App Icon" numbers on the home screen's Messages icon.
This is a great alternative to putting your entire iPhone on Do Not Disturb mode, especially if you only have one or two contacts that bombard you with message after message.
However, if one of the contacts you've just muted in Messages is set as an "Emergency Bypass" contact, note that you will still not see or hear any notifications or alerts for them. This setting overrides that. Hearing an "Emergency Bypass" text tone only applies for the main Do Not Disturb feature, not the one for conversations in Messages.