Tap on the Habitat that holds the dragon of which you want to change the name. Tap on your dragon and tap its name to edit it.