A brief history of the discovery and naming of the dinosaurs
The original discovery of the dinosaurs is difficult to pinpoint. At least hundreds, but possibly thousands, of years ago the Chinese are known to have used ground-up dinosaur fossils in various medicines, thinking they were dragon bones. No doubt other cultures were aware of these strange fossils too, particularly plausible given some Greek and Roman myths, and it could very well be the case that some forward-thinking person we've never even heard of was fully aware of what these bones represented.
More recently, dinosaur bones were either found and somehow lost again (as with a thigh bone in New Jersey, in 1787, where Caspar Wistar missed out on his chance to "discover" the dinosaurs), or simply not recognized as belonging to something completely new.
We can safely say there were a lot of wasted opportunities before an official discovery came along.
Who officially discovered the dinosaurs?
The first dinosaur to be officially described was the Megalosaurus in 1824, discovered by Reverend William Buckland (1784 – 1856), an English palaeontologist and geologist. This was the first full scientific account of a dinosaur specimen, though the term "dinosaur" itself was not coined until later.
The first recorded Megalosaurus bones were actually discovered much earlier, in 1676, but their discoverer obviously failed to make things official!
Buckland was almost beaten to the official discovery of the dinosaurs by Gideon Mantell (1790 - 1852), who discovered the Iguanodon. Mantell was a doctor, and either he or his wife (accounts vary depending on the source) discovered a fossilized tooth in 1822, 2 years before Buckland named and described his Megalosaurus.
Mantell presented his find to the Royal Geological Society of London in 1822, with Buckland in attendance, but was met with the consensus that his tooth was from a rhinoceros or possibly a fish (Buckland himself came to this conclusion). The tooth was also shown to the famous French naturalist Georges Cuvier, a supremely talented and respected man in the fossil world, but was once again dismissed as being from a rhinoceros. Cuvier realized his mistake and retracted the statement, but unfortunately word of this retraction did not make it back to Mantell, who heard only of the dismissal. It is probably safe to assume Mantell was a bit dismayed by this point.
Eventually, with Buckland's discovery and subsequent description of the Megalosaurus bones it became clear that Mantell's find was of a similar nature, although the Iguanodon was a herbivore and the Megalosaurus a meat-eater. The Iguanodon was finally described by Mantell one year later in 1825, named due to the similarity between the tooth he discovered and those of an iguana, although the two species are in no way related.
Who first named the dinosaurs?
The term "dinosauria" was first coined by a British anatomist, Sir Richard Owen (1804 – 1892), in 1841. The name literally means "terrible lizard", which seems an odd choice since Owen was perfectly aware that these were not in any way lizards. Perhaps he just liked the sound of it, and thought "why not?".
Owen based his classification on similarities between some of the recent finds, including Megalosaurus and Iguanodon, but originally intended the new taxonomy to aid him in his argument against Darwin's new theory of evolution. In the end, of course, it did exactly the opposite.
Disputes among the fossil-hunters
Two of the major players in the discovery and naming of the dinosaurs, Gideon Mantell and Richard Owen, had further parts to play.
Mantell went on to discover further dinosaurs, and both men continued to study the Iguanodon. Owen, in his attempts to bring the discovery in line with his beliefs on evolution, insisted the Iguanodon was built along the same lines as mammals. He believed the Iguanodon walked on all fours, whereas Mantell collected sufficient evidence to prove that it was actually bipedal, walking on hind legs.
Unfortunately for Mantell he suffered a serious accident in 1841 and was left crippled, in permanent pain. Understandably this put a bit of a damper on his efforts to contradict Owen, who was by this point very well-connected indeed. Owen embarked on a mission to discredit Mantell entirely, claiming original discovery of the Iguanadon (as well as renaming and reclaiming other Mantell-discovered dinosaurs) for himself.
Thankfully Owen was eventually found out, and dismissed from his position in the Royal Society for plagiarism. Credit now falls where credit is due!