i been asked this a couple of times over the last weeks and i know its a long lost art to name a droid :P.
In order to name your droid, first open the droid's radial menu and choose the command that you wish to program. You will need to program 4 different commands, each time using the same name, spelled the exact same way. You must either say the command and name in spatial, or using /tellpet.
A droid name can only consist of characters that are usable in Character name generation. ( IE A through Z - ' ) At this time, numbers and other characters can not be included in the name of your droid.
Key words such as Jedi, Rebel, and Medic aren't allowed by the name filter, along with a list of other words that cannot be used during character generation.
A name can be 28 letters in length, with a 1 letter long command. If done correctly, on the fourth command the droid will respond with (DroidsNameHere) ? in both Spatial and above its head.
Medical Droids, Battle Droids, Protocol Droids, and LE Repair Droids can not be named.