See the article What to do after you change your Apple ID or password - Apple Support
Messages
After you update your Apple ID, your friends will receive new messages from your updated Apple ID. Old messages aren't removed.
iPhone, iPad, and iPod touch
Go to Settings > Messages, then tap Send & Receive.
- If you're signed out on your iPhone or iPod touch, tap "Use your Apple ID for iMessage" then enter your updated Apple ID and password. On your iPad, just enter your updated Apple ID or password.
- If you're signed in with your previous Apple ID, tap your Apple ID, then tap Sign Out. On your iPhone or iPod touch, tap "Use your Apple ID for iMessage" and enter your updated Apple ID or password. On your iPad, just enter your updated Apple ID and password.