Because there’s so much confusion about what it means for any creature—not just a dinosaur—to be “cold-blooded” or “warm-blooded,” let’s start our analysis of this issue with some much-needed definitions.
Biologists use a variety of words to describe a given animal’s metabolism (that is, the nature and speed of the chemical processes taking place inside its cells). In an endothermic creature, cells generate heat that maintain the animal's body temperature, while ectothermic animals absorb heat from the surrounding environment.
There are two more terms of art that further complicate this issue. The first is homeothermic, describing animals that maintain a constant internal body temperature, and the second is poikilothermic, which applies to animals whose body temperature fluctuates according to the environment. (Confusingly, it’s possible for a creature to be ectothermic, but not poikiothermic, if it modifies its behavior in order to maintain its body temperature when faced with an adverse environment.)
As you may have surmised from the above definitions, it doesn’t necessarily follow that an ectothermic reptile literally has colder blood, temperature-wise, than an endothermic mammal. For example, the blood of a desert lizard basking in the sun will temporarily be warmer than that of a similar-sized mammal in the same environment, though the lizard’s body temperature will drop with nightfall.
Anyway, in the modern world, mammals and birds are both endothermic and homeothermic (i.e., “warm-blooded”), while most reptiles (and some fish) are both ectothermic and poikilothermic (i.e., “cold-blooded”).. So what about dinosaurs?
For a hundred or so years after their fossils began to be dug up, paleontologists and evolutionary biologists assumed that dinosaurs must have been cold-blooded. This assumption seems to have been fueled by three intertwined lines of reasoning:
1) Some dinosaurs were very big, which led researchers to believe that they had correspondingly slow metabolisms (since it would take a huge amount of energy for a hundred-ton herbivore to maintain a high body temperature).
2) These same dinosaurs were assumed to have extremely small brains for their large bodies, which contributed to the image of slow, lumbering, not-particularly-awake creatures (more like Galapagos turtles than speedy Velociraptors).
3) Since modern reptiles and lizards are cold-blooded, it made sense that “lizard-like” creatures like dinosaurs must have cold-blooded, too. (This, as you may have guessed, is the weakest argument in favor of cold-blooded dinosaurs.)
This received view of dinosaurs began to change in the late 1960’s, when a handful of paleontologists, chief among them Robert Bakker and John Ostrom, began to promulgate a picture of dinosaurs as fast, quick-witted, energetic creatures, more akin to modern mammalian predators than the lumbering lizards of myth. The problem was, it would be extremely difficult for a Tyrannosaurus Rex to maintain such an active lifestyle if it was cold-blooded--leading to the theory that dinosaurs may in fact have been endotherms.