So, as per Jone and others, obviously the criterion for grave sin is when you lose control of your rational faculties to the that you'd be inclined to commit a grave sin that you would not have without said impairment. Now, this may vary from one individual to another, as there are angry drunks who will become violent and thrash their family, for instance, and there are immoral drunks who will commit sins against purity ... but there are also some who would not react that way. Finally, there may be proportionately-grave reasons to justify being intoxicated to the point of losing control of your faculties, e.g. serious pain (getting drunk to undergo surgery, no different than if you were taking morphine or something similar).
Similarly, lesser degrees of intoxication may be sinful if there's no (less grave) proportionate reason, i.e. you're just doing it for the euphoria, in that this can lead to a certain amount of dissolution (even if not grave sin) where you're in a condition where you lack serious and reverent thoughts about God and the Catholic faith ... but if you have reasons such as being prone to anxiety and need to relax after stress (vs. euphoria for euphoria's sake), or even just to be social (some people become more social when slightly intoxicated), etc. ... just something that's conducive to the good of your nature and therefore your soul, it can certainly be without any sin whatsoever to become slightly intoxicated.
Precisely which substance you're talking about doesn't figure in per se, but it can be accidentally more grave. So, for instance, certain drugs are very likely to get you hooked for life even with a single use, and risking becoming an addict would be a grave sin, where addicts often end up in lives of crime and sin, where they need to steal or prostitute themselves in order to finance their habit, and they can lose their jobs and their ability to provide for their family, and that's even if it's not super-addictive but simply illegal where if they got caught (with some random drug test at work) or else were caught in possessions, and therefore risked getting fired, that would be a grave sin just on those grounds. So, for instance, in my case, even though I see no moral problem per se with a tiny bit of micro-dosing THC (you could microdose to relieve anxiety without any highs or danger of losing control of your rational faculties), it would still be grave sin per accidens for me because my job does random drug tests and if any showed up in my system I'd be terminated immediately, and I would then be unable to provide for my family. Finally, it's sinful also to not obey just laws, so if there's a just law in place regarding drugs and you disobey it without proportionate justification, that could be a sin on its own right. But these last considerations render it immoral on other grounds extrinsic to the actual effects of the drugs themselves.