Series 4000 mechanoids were modular units, able to remove defective or malfunctioning parts and replace them with spares supplied by DivaDroid International. Kryten had three spare heads which he kept in a storage locker aboard Red Dwarf.
It was unknown if he had brought them with him from Nova 5 or had acquired them after he joined the Red Dwarf crew. The spare heads rested on a shelf facing the door. They all shared Kryten's core personality to begin with, but considered themselves to be separate entities. Kryten would visit them regularly, even allowing them to take turns as main head on a rota basis. Presumably Spare Head 3 had this privilege before developing Droid Rot.
When Kryten was converted into a human by the DNA transmogrifier, he visited his spare heads to explain what had happened. He told them that they would no longer be able to take turns as main head. Spare Heads 1 and 2 were upset that Kryten seemed to have forgotten them for days. Spare Head 3 had suffered extensive Droid Rot after years of neglect and spoke with a broad Yorkshire accent. He was convinced that Kryten had sold out and told him to leave. ("D.N.A.")
Kryten later took his Spare Heads aboard Starbug. When he had refused to allow Lister to use the time drive to fetch a huge curry order, Lister swapped his main head for Spare Head 2. He managed to convince Spare Head 2 to disobey Kryten's wishes and pretend to be main head. Lister disabled Spare Head 2's behaviour protocols, making him incapable of feeling guilty for his actions. ("Tikka to Ride")
At one point, Kryten's Spare Heads had held a vote and decided that he was the big-eared, ugly one. ("Stoke Me a Clipper")
When Kryten's negadrive overloaded, it made his head explode. When his crewmates tried to replace his head with a spare, it also blew up, followed by a second and a third. Three new Spare Heads were found aboard the SS Centauri, but they were missing their primers, making them useless. The crew managed to bargain with a simulant for the primers, but he stole Kryten's body and had his mechanoid Able replace the head. ("Beyond a Joke")
Behind the scenes
All the spare heads seen on the show were played by Robert Llewellyn. He had to film the scenes multiple times to play different heads.