It means you have muted notifications for that conversation. When the crescent moon icon is shown beside a contact's name in the messages list in the Messages app, it means that you have selected not to receive notifications about new messages from that contact.
How do I get rid of the crescent moon on my iPhone?
Option 1: Access the control center by pulling up on your iPhone screen (or from the upper right corner on the iPhone X and later). Then, tap the half moon icon to turn off the “Do Not Disturb” mode. The little box will turn white when “DND” mode is turned on.
What does a moon next to a contact mean?
When viewing the list of messages in the Messages app, the crescent moon icon to the left of a conversation means that Do Not Disturb is enabled for that conversation. This can be turned on or off to mute or un-mute notifications for that conversation as desired.