When the unwanted message are SPAM, you can stop receiving them by sending the word STOP to the number from which you have received the SMS message and it will stop the messages from that service.
More generally, most mobile operators will allow you to block SMS (text messages) to your phone.
You need to call your particular operator to find out what service they offer to do so. Verizon Wireless, for example, allows you to block up to five phone numbers. You can do this through your account online or by calling.