The iMessage messaging app on your iPhone is very practical and the incoming messages are conveniently synced with your other Apple equipment. But it creates a barrier if you want to switch to (for example) Android. In such cases, you can disable iMessage. Here you can read how to do that.
Are you going to switch to Android or Windows Phone? As long as iMessage is still active on your phone number, text messages will not arrive on your other phone. Only on Apple devices where you can read the messages. You can deactivate iMessage on your (old) iPhone, but it is recommended that you unsubscribe from iMessage completely. Also read: How to set up iMessage.
Deactivate
On the iPhone on which you want to deactivate iMessage, go to the Isettings, choose your Bnotice and then turn off the switch at iMessage. The best thing to do is go into the settings FaceTime choose to disable it in the same way.
Sign out
Because iMessage is linked to your phone number, you have to manually deactivate your number at Apple. Apple has created a special site for this: https://selfsolve.apple.com/deregister-imessage. Scroll down, choose your country and enter your phone number you want to unlink from iMessage. A verification code will be sent to the number you enter on the page. After you click Submit press your phone number is disconnected from iMessage.