Depends on the project. For example, we have been building a new house and have taken on nearly all of the finish work ourselves. Nearly all trim including craftsman door headers, tub surround parts, etc were stained in the garage shop prior to installations, then final finish after installation. Some of the parts, including base and window trim were stained and poly'ed in the shop prior to installation. However, most parts don't get final finish until installed.
Some stuff that requires careful fit and attachment are stained and finished in place. My personal preference would have been to assemble or attach a lot of the stuff in place; then stain and finish. But when you are working next to painted walls and finished hardwood flooring, that isn't always practical.
Gluing requirements always have to be in the back of you mind when planning.
When I do normal projects such as small cabinets, rocking horses, quilt stands, etc.; I usually stain the final project at one time including side-assemblies such as drawers.
Ron.