It may come as a shock to the average dinosaur buff, but the Triassic, Jurassic, and Cretaceous periods weren't originally designated as a way to keep track of long-extinct reptiles. Rather, these vast stretches of historical time were marked out by geologists to distinguish among various types of geologic strata (chalk, limestone, etc.) laid down tens of millions of years ago. Of course, since dinosaur fossils are usually found embedded in rock, paleontologists associate dinosaurs with the geologic period in which they lived--for example, "the sauropods of the late Jurassic."
To put these geologic periods in the proper context, you should bear in mind that the Triassic, Jurassic and Cretaceous don't cover all of prehistory, not by a long shot. First came the Precambrian period, which stretched from the earth’s formation to about 542 million years ago. The development of multicellular life ushered in the Paleozoic Era (542-250 million years ago), which embraced shorter geologic periods including (in order) the Cambrian, Ordovician, Silurian, Devonian, Carboniferous and Permian periods. It's only after all that that we reach the Mesozoic Era (250-65 million years ago), which includes the Triassic, Jurassic and Cretaceous periods.
Next Page: The Triassic Period