Minecraft wiki entry for NPC, associated text: Name
The name of an NPC can be entered in the top text pane titled "Name". The text limit for the name is 32, and the color can be changed by using the color codes as by default the color is yellow (§e).