This comes up a lot at baseball games. As a woman who wears all kinds of hats, I've made sure that I've got my hatiquette (sorry...) sorted out.
If a woman's hat is a woman's hat (as in, meant to be an accessory to an outfit), it stays on.
If the hat a woman is wearing is a "man's" hat or a sports cap (like a baseball cap), it comes off.
As someone who wears a stetson as outwear in the weather, I take mine off. I have no idea about the cowboy hats in this one, but if it were to follow the "general" working/sports hat etiquette above, they come off. HOWEVER, it may be perfectly acceptable in that realm of hat culture to leave them on.
Of course, I'm not going to question someone's patriotism over it.