When dealing with pressure vessels, you should not rely on rules of thumb. You should rely instead on the ASME Boiler and Pressure Vessel Code or whatever code is required by your local enforcement or regulatory body.
There are far too many variables for a one-size-fits-all answer. The design pressure/temperature, materials of construction, flange configuration, gasket material, etc all play a role.
Bolts are not typically used for these types of connections. Instead you would install a threaded stud in the vessel and then use a washer and nut to hold the flange.
Section VIII Division 1 UG-43 states that a tapped hole for a stud shall engage the stud for a length not less than the larger of $d_s$ (the nominal stud diameter) or $$0.75d_s \times \Big( \frac {maximum \space allowable \space stress \space value \space of \space stud \space material \space at \space design \space temp}{maximum \space allowable \space stress \space value \space of \space tapped\space material \space at \space design \space temp} \Big)$$
except that the thread engagement need not exceed 1.5$d_s$.