Here's hoping you never need to use this bit of information, but just in case: Popular Science's Christina Cale has a rough estimate of how long you could safely breathe in a coffin buried six-feet underground.
The variable are, naturally how big the coffin is and how big you are.
Let's say the average casket measures 84 by 28 by 23 inches, so its total volume is 54.096 cubic inches, or 886 liters. We'll use that as the internal volume too, to give you a few extra minutes of life. And the average volume of a human body is 66 liters. That leaves 820 liters of air, one-fifth of which (164 liters) is oxygen. If a trapped person consumes 0.5 liters of oxygen per minute, it would take almost 5 and a half hours before all the oxygen in the coffin was consumed.
Of course, those five and a half hours will be spent in claustrophobic horror, as you futilely try to escape. Which isn't gonna happen.
Even if you were able to get out of the coffin without exhausting your air supply first, you’d find yourself in a situation similar to being buried in a mega-landslide or avalanche. The dirt would be so dense and heavy that your chest wouldn’t be able to expand.
But there's a plus side to all this! Assuming you don't get yourself covered in dirt, eventually the carbon dioxide will build up so much that you'll pass out and become comatose, so you won't actually be cognizant during your death by suffocation. So that's good!
In summary: Try not to get buried alive.