Where did Tolkien get his names from? - Language in the Rings
All the names of people, things and places come from real people, old languages, or languages that he made himself. He used Old Norse, Old English and Finnish, as well as making up several Elvish languages, Orcish and many others.
Here is a list of just a few words and their roots:
Frodo: from Frodi, a Norse King.
Sam Gamgee: Dr Sam Gamgee lived near Tolkien and invented a type of medical cotton wool.
Gandalf: from Old Norse, it means elf with a staff.
Aragorn: from Sindarin, an elvish language Tolkien made up, it means King-Tree.
Sauron: from Old Norse, it means abominable.
Saruman: from Old English, it means cunning man.
Legolas: from Sindarin, it probably means green-leaf
Galadriel: from Sindarin, meaning tree-daughter
Mordor: from Old English, it means murder or mortal sin
Theoden: King of Rohan, his name means King or Lord of Men
Edoras: capital of Rohan, it means enclosures.
Grima: he is a bit suspicious and his name means mask.
With thanks to Dr Thomas Shippey.