On iPhone: Open the conversation with the contact you want to change. Tap their profile picture in the top right hand corner to open the conversation settings. Tap 'Edit' to edit the conversation settings. Enter a new nickname for the contact.
On Android: From the main contacts/conversations screen, long press on the contact you wish to change the nickname of. Then tap 'details' and the edit button. Enter the new nickname and hit the 'tick' button.
On desktop: Right-click on the contact you want to change. Click 'Change Nickname'. Enter a new nickname and click 'OK'.