The short answer: no
There was no human life alongside the non-avian dinosaurs, the group that includes animals like T. rex, Triceratops and Brachiosaurus. These dinosaurs died out about 66 million years ago. The earliest members of the human genus appeared only a few million years ago, and our own species, Homo sapiens, around 300,000 years ago.
In other words, tens of millions of years separate the last of those dinosaurs from the first humans.
How big the gap really is
It is hard to picture 66 million years, so a comparison helps. If you squeezed the time since the dinosaurs died out into a single 24-hour day, Homo sapiens would show up only in roughly the last six or seven minutes before midnight.
Even the time between different dinosaurs is huge. Stegosaurus lived in the Late Jurassic, around 150 million years ago, while T. rex lived at the very end of the Cretaceous. That means T. rex lived closer in time to us than to Stegosaurus.
How scientists know
Rock layers and dating
Rocks laid down over time form layers, with older layers generally beneath younger ones. Geologists can date many of these layers, especially volcanic ash beds, using radiometric dating, which measures the steady decay of certain radioactive elements. Dinosaur fossils come from rocks of the Mesozoic Era, which ended about 66 million years ago. Human fossils and stone tools come from far younger rocks.
No mixed fossils
If humans and non-avian dinosaurs had lived together, we would expect to find their remains in the same rock layers at least occasionally. Across a very large number of fossil sites studied around the world, that has not happened. Human bones and tools turn up only in much younger deposits.
Another clue is the layer marking the end of the Cretaceous, which in many places contains unusual amounts of iridium and other signs of a large asteroid impact. Non-avian dinosaur fossils are found below this boundary, not above it. For more on that event, see where is the crater that killed the dinosaurs.
Who did live with the dinosaurs
Early mammals
Mammals did share the world with dinosaurs for a very long time. The first mammals and their close relatives appeared in the Triassic, not long after the earliest dinosaurs. Most stayed fairly small, often shrew to cat sized, though there were exceptions. One well-known fossil of Repenomamus, a badger-sized mammal from China, was found with the remains of a young dinosaur in its stomach area.
You can read more about these animals under mammals during dinosaur age.
Early relatives of primates
Primates, the group that includes humans, may have started branching off near the end of the dinosaur age. Some small, early primate-like mammals are known from very shortly after the extinction, and some genetic studies suggest the primate line could be a bit older. These animals were small tree-dwelling creatures, nothing like humans. The question of what human ancestor lived with dinosaurs looks at this in more detail.
The one sense in which we do live with dinosaurs
Most paleontologists consider birds to be living dinosaurs, descended from small feathered theropods. So in a technical sense, humans do live with dinosaurs every day, whether that’s a pigeon, a chicken or a hummingbird. It is only the non-avian dinosaurs, the ones people usually mean, that we never met.
Claims of humans and dinosaurs together
Over the years there have been claims of human footprints beside dinosaur tracks, most famously in the Paluxy River bed near Glen Rose, Texas. On closer study, these so-called “man tracks” turned out to be eroded or partly filled dinosaur tracks, other natural marks, or in some cases carvings. Other claims, such as ancient figurines or carvings said to show dinosaurs, have not held up to scientific scrutiny.
Why the idea is so common
The idea of people and dinosaurs together is everywhere in popular culture, from cartoons like The Flintstones to adventure films. It also makes for a fun thought experiment, which is why so many people wonder “Could humans survive if dinosaurs existed?” But the evidence from rocks, fossils and dating methods all points the same way: humans arrived long after the non-avian dinosaurs were gone.