Use the text box object and a button object.
Then do this :
global variable playerName = ""
on button clicked AND textbox.text ≠"" → set playerName to textbox.text
Then to use the variable into a text, write the PNJ text like this :
« Hi [player], nice to see you again in my unicycle shop ! »
And do this event :
pnj.text = replace(pnj.text, "[player]", playerName)
It will replace [player] by the playerName variable.
https://www.scirra.com/manual/126/system-expressions is a good place to find stuff like this. <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">