I'm a great fan of Tolkien's books, especially The Lord of the Rings and The Hobbit. One thing I have always wondered about in his books though, is whether the Elvish tongues were actually fully new languages. Were they totally constructed as it were from scratch, or was Tolkien patterning them after some European / other languages that were actually in use (or ancient languages out of use)?
Tolkien started really early in his life to develop languages. Started at 13 and developed languages till his death.
Tolkien was a professional philologist and a specialist in the Old English language. He was also interested in many languages outside his field and developed a particular love for the Finnish language (he described the finding of a Finnish grammar book as "entering a complete wine-cellar filled with bottles of an amazing wine of a kind and flavour never tasted before".
Finnish morphology (particularly its rich system of inflection) in part gave rise to Quenya. Another of Tolkien's favorites was Welsh — and features of Welsh phonology found their way to Sindarin. Numerous words were borrowed from existing languages, but less and less obviously as Tolkien progressed. Words that are an exact match with existing Welsh words can be found in the early drafts of Tolkien’s manuscripts published as The History of Middle-earth, but attempts to match a source to a particular Elvish word or name in works published during his lifetime are often very dubious.
Source: Languages (Tolkien Gateway)
Tolkien took inspirations from lots of existing languages. His inventions bear much resemblance to those languages in phonology and in syntax, but less obviously so in vocabulary.
Ken's answer already presents the two best known languages (Finnish and Welsh) that gave rise to Quenya and Sindarin, but they were not all.
Actually it[Quenya] might be said to be composed on a Latin basis with two other (main) ingredients that happen to give me 'phonaesthetic' pleasure: Finnish and Greek. It is however less consonantal than any of the three. (Letters)
A Latin student can easily recognize the shared stress rule between Quenya and Sindarin in the Appendices.
In longer words it falls on the last syllable but one, where that contains a long vowel, a diphthong, or a vowel followed by two (or more) consonants. Where the last syllable but one contains (as often) a short vowel followed by only one (or no) consonant, the stress falls on the syllable before it, the third from the end.
Words in Quenya that begin with ps-, ks-, I think, show some Greek influence.
And there is Danian "in general a Germanic type", Ossiriandic - Old English, East Danian - Old Norse, Taliska - Gothic, West Avarin - Irish, West Lemberin - Finnish, East Lemberin - Lithuanian (ibid.). Most of the dialects mentioned here only exist in the Comparative Tables though (or remain unpublished).
As mentioned on Wikipedia, it was modelled on Welsh and some other Norse languages:
Sindarin was designed with a Welsh-like phonology. It has most of the same sounds and a similar sound structure, or phonotactics. The phonologies of Old English, Old Norse and Icelandic are also fairly close to Sindarin and, along with Welsh, certainly did have an influence on some of the language's grammatical features, especially the plurals (see below).