Dinosaurs lived between ~250 million and ~65.5 million years ago. This huge time period is called the Mesozoic Era. Mesozoic means "middle life." The Mesozoic has been called "The Age of Dinosaurs."
The Mesozoic is divided into three periods. The first is the Triassic. It was between 250 and 205 million years ago. The Jurassic lasted from 205 to 145 million years ago. The Cretaceous lasted from 145 to 65.5 million years ago. (The years of each are ~approximate.) Different kinds of dinosaurs evolved during the millions of years of the Mesozoic. Some became extinct early in that era. Other kinds appeared later in the fossil record.
Dinosaurs were not the only animals that lived on Earth during the Mesozoic. Dinosaurs walked on land. Some large lizard-like animals that were not dinosaurs flew in the sky (pterosaurs) and swam in the seas (plesiosaurs and ichthyosaurs). There were insects, fish, frogs, and crocodiles. Birds and small, furry mammals lived at this time, too. There were no people living when the dinosaurs lived.