A couple of things to consider: If you accidentally spill glue on your pieces, the stain will not penetrate it.
So, this argues in favor of staining before gluing.
However... If you get stain on the joints, the glue will not work (or at least it won't work as well).
I think things are typically stained after the fact except in rare circumstances such as for a frame and panel door.
However, I think either works as long as you're aware of the two pitfalls mentioned.
Good luck!
woodworking.stackexchange.com/users/3/dfife
I prefer to tape up my glue joints, then stain / poly / paint.
After that, fix any finishing boo-boos, remove the tape, glue up, and you're good to go.
This provides the benefit of getting stain and/or paint / finish in all the nooks and crannies, allows you to fix any drips or bobbles in the finish with everything laying flat, and if you do get some expansion around the joints, you're not presented with an unstained bit of wood showing.
On edit: If I'm worried about glue coming out onto the finished surface during glue-up, I just place tape right next to the un-glued surface so that if glue squeezes out and I don't catch it, it's on tape, not finish.
woodworking.stackexchange.com/users/191/TX Turner
Glue.
SAND Stain/Finish
I have had this scenario come up before and the best method I have found thus far is to clean as well as you can while you are gluing, then once the glue is set lightly sand the joints with a fine grit paper (sand evenly across all the board(s).
I do this even if I do not see noticeable glue marks prior to finishing as I have thought I was fine then realized as the stain was being applied that there was in fact glue.
I would also not generally suggest applying tape to wood.
Depending on the tape and the wood adhesive can be left behind which will lead to problems similar to the glue problem in the first place.
woodworking.stackexchange.com/users/212/James
I always glue up my stuff first, and I always sand all the joints after I'm done to make sure they are even and
any glue that was on the outside of the joint is removed so the wood will take a stain and not be blocked.
woodworking.stackexchange.com/users/27/bowlturner
Most people build and then finish (especially if the finish is applied by someone else).
Assuming you are diligent, regarding cleaning up the glue as it is pressed out this works fairly well.
However if the glue sets then true stains (that is something designed to be absorbed into the wood fibers) will not take to the area covered in glue.
Usually, this is a tiny bit of surface which is ignored or covered in similar or slightly darker color of opaque finish or paint.
For stains that are opaque (or not very transparent), a few extra coats will hide the offending area.
For myself, when these approaches aren't enough I will finish the surfaces of the pieces to be glued together first and then glue them together.
This implies you have decided on a finish and set of colors for the finished piece and this can be tricky if you are using the finishes to help different cuts of wood look similar.
It also takes more time.
Another approach is to use a water soluble stain or dye (like Van Dyke Crystals) to color the wood, then glue and then apply see-though finish with little or no color like shellac or varnish.
In this approach, the shellac will coat any glue you may have missed but the color will match the area without glue.
The tricky part here, is not to sand through the finish and cut into the wood revealing an unstained area.
The bonus is you can glue the stained wood without issue.
I have not had great luck with tape; there is a slight seam created where the glue fills the slight edge of the tape.
It may not be noticeable at first glance, but it is easy to feel with your fingers.
Having said that, I have not tried any of the new tapes available for painters.
woodworking.stackexchange.com/users/111/ewm
I've watched many videos in which people glue up panels and such and I've seen them use very little glue with almost no squeeze-out as well as huge amounts of squeeze-out and glue dripping everywhere.
I try to minimize squeeze-out; the ability to estimate how much glue to squirt on comes with experience.
But when it does squeeze out, I try to come back in about 20 minutes and scrape off the squeeze-out with a putty knife.
At that time, it's pretty stiff but still very easy to scrape off.
If you wait till it's hard, the process is a bit more difficult.
woodworking.stackexchange.com/users/178/glw
I did some experimenting the other day and found that yellow glue is easy to color with artist's pigment (a fine colored powder use in frescos etc.).
I can see that there might be situations where coloring the glue
might mitigate problems of glueing first.
It depends on the color of the wood.
The wood I use is Guanacaste a very dark wood with black streaks.
In some cases black colored glue might work out.
woodworking.stackexchange.com/users/309/Carl Carlson
I've tried both ways.
When raising panel doors, I stain my panels before I put them into the frame.
I use rubber balls for expansion in the raise panel doors.
I glue the joints when I assemble door then stain the frame.
woodworking.stackexchange.com/users/3239/user3239
I stained my wood before putting my table top to my coffee table......
i am now starting over.
I allowed th glue to dry for 2 days when I went to pit the table top on the legs in several spots the table top started pulling apart.
I would never again first I can always sand the spot where I may jabe gotten glue then stain it.
woodworking.stackexchange.com/users/8626/Stephanie R Aaseng
After you've fabricated your pieces, is it better to "glue-up", then stain? Or is it better to stain first, then glue? What's a good rule-of-thumb?
Stain then glue, or vice-versa?
woodworking.stackexchange.com
<staining><glue><assembly><process>
woodworking.stackexchange.com/questions/361
woodworking.stackexchange.com/users/192/Jeromy French
things are typically stained after the fact except in rare circumstances such as for a frame and panel door. Most people build and then apply stain or finish, except for frame and panel doors, for example. However, some people may mask of the glue joints and then apply  stain/finish
Some people may mask of the glue joints and then apply  stain/finish. it appears that most people build and then apply stain or finish, except for frame and panel doors, for example.