In general, the queen represents dynamic play (or at least the potential for it).
So (again, generally speaking) you should like to trade queens when you have static advantages to play against like pawn structure. Trading queens reduces your opponent's counter play and doesn't diminish your ability to exploit the static weaknesses.
If your play in the position is based more on dynamics, like they're behind in development, loose king, uncoordinated pieces, then in general you'll want to keep queens on. Trading would usually diminish your ability to exploit those elements.
Material is a static advantage, so usually trading queens is good, but remember to evaluate trades by looking at what's left on the board, not what's coming off. After any sort of trade (not just queens) if their remaining pieces are more active than yours it's usually not a good trade. Having much more active pieces can easily compensate being down a pawn or two.
Of course the reverse is also true -- if your pieces are much more active then go for it. For example even if 100% of your play is based on a mating attack, a queen trade can be good for you if all your other pieces are active, and the attack continues.
Are there some general guidelines on when it is good to go for a queen trade in the middlegame? I have made several inaccuracies on being up material, up a pawn or two, etc.. where I thought a queen trade would only help me realize my advantages but it botched it instead. I was just wondering if there were some rules of thumb on when it is a good idea to trade queens since I've never really heard of any. Thank you for your time.