Symptoms
You previously used an iPhone and Apple's iMessage service. You then switched to a non-Apple cellular phone (for example, an Android phone). When a user of an Apple device tries to send you a text message, the message goes through iMessage instead of through the cellular networks as an SMS or MMS message. You never receive the message.
Cause
When you got rid of your iPhone, you did not sign out of iMessage before giving it away, selling it, erasing it, etc. This leaves your phone number registered with Apple's iMessage service as an active iMessage number. When an iOS user tries to send you a message, it then goes to Apple's iMessage service instead of through the cellular networks to be routed as an SMS or MMS message.
Resolution
Deregister your number from Apple's iMessage service.
Outcome
You will be able to receive SMS and MMS messages again from iPhone users.