It depends on what you're inhaling.
Unfortunately, in most cases, you would most likely lose consciousness long before you'd able to kill yourself from this. Kinda like how people can't kill themselves by holding their breath. They can get to the point of losing consciousness, but then the body's natural defense takes over (i.e. you drop the aerosol from your face and your body begins to chemically rebalance once the normal oxygen supply is restored, which will almost always happen before a lethal amount has been achieved). In the case of suffocation like this, the amount of time it takes to die once you've lost consciousness is generally around 5 minutes, assuming your oxygen supply is not restored.
That being said, some inhalants are more toxic and/or highly concentrated than others, which can cause problems with your heart that could lead to serious cardiac events. The key here would be to do your research on which inhalants are most toxic to humans.
If you decide to go this route, you would want to make sure you block as much ventilation as possible (i.e. duct tape cracks under doors, close air vents and windows, etc). As for how long it would take to die in this case, it's hard to say because it really depends on what you use. I believe the average time it takes to die from cardiac arrest is generally around 5 to 10 minutes.
All in all, if you're looking for a peaceful (but effective) method, I personally wouldn't recommend this method.
And now that I've given you my logistic input, may I ask why this is the method you're considering? Even though your post is short and to the point, and doesn't necessarily say much about you, it seems like maybe you're younger or maybe this would be one of your first attempts to ctb? My apologies if my assumptions are incorrect or if you take offense to them. I'm mainly curious because I remember when I was younger and started to feel this way, this is very similar to the questions I had. If you're below the age of 26, I would strongly recommend trying medication and SOME form of counseling (I say some because there's many different types of counseling services) before you do make an attempt that could leave you disabled or disfigured for the rest of your life if you're not successful. If you're below the age of 26, your brain isn't fully developed yet, meaning there's a chance that taking medication for a period of time could potentially correct the chemical imbalance you're experiencing, and there's a chance you don't have to feel this way forever.
By all means, this is your life and your choice to make, and I respect your decision regardless. I just figured that as long as I'm responding, I'd throw that in there. Just in case.