In both cases, the residence time is the time the solid/gas remains in the reactor. The average gas residence time is the volume of the vessel divided by the actual (not standard) volumetric flow rate. More accurately, it is the volume of gas in the vessel divided by the gas volumetric flow rate. The volume of gas could be less than the volume of the vessel if the solid loading is high. The solid residence time is the particle path length divided by the average solid velocity.
For liquid and solid systems i agree with Prof.Larry L.Baxter but for gaseous system temperature changes can make the system as variable density/volume.Therefore, expansion factor has to be taken in to account or multiply the formula suggested by the Prof with actual temperature divided by standard temperature.
I should perhaps have emphasized that the residence time is the volume divided by the actual, not the standard, volumetric flow rate. This accounts for gas expansion. I will edit the original response to make this clear.