Not only dinosaurs, but all living things either evolved or extinguished. Periodically, the Earth goes through a time of a "Great Die-Off," where the environment is so quickly and radically altered that most living things die. Those that remain produce descendants that are more able to fit into the new environmental niches. That process may have happened relatively quickly, in terms of geologic time. In terms of long-term evolution, it's interesting to note that certain areas will develop their own life forms -- Australia, being genetically isolated after the Pangaea breakup, went on to evolve creatures that were (and are!) found nowhere else on the planet.
It seems clear that the breakup of Pangaea, which started during the Jurassic Period (about 175 million years ago) had an impact on dinosaurs. Some ways that this happened:
- The breakup caused there to be more kinds of habitats for dinosaurs to live in. There was now much more coastline, more rift valleys, and less desert. This created more ecological niches where new species of dinosaurs could evolve.
- As the breakup happened, there were a lot of volcanic eruptions. About 35% of all animal species, including many dinosaurs, became extinct.