It's a question of class. In the real upper crust, they always walk around with their shoes on indoors at home. And there are actually some 'lower class' groups where they do too. But the huge majority of people in between normally take their shoes off indoors at home. (also, you may be expected to bring special indoors shoes for dressed-up events, especially if the weather is dirty).
So this is an area where you can easily reveal your social background.
I can only speak for the people I know. I don't think there is a national average. However, I am quite sure that most people take off their shoes indoors. Simply for comfort. When it comes to guests, that depends not on class but on neatness. If the host prizes clean floors they won't allow it. I do know many people who will say "nah" if I ask whether or not I should I take off my shoes.
In my experience it depends much more on region than on class. In Canada and snowier parts of the US (northern midwest, New England, …), most people I knew considered it unusual and rude to wear outdoor shoes indoors. In other parts of the US I’ve spent time (California, Pittsburgh), it was normal to keep your outdoor shoes on indoors. In the UK, it’s more variable; plenty of people take off their shoes to come in, others don’t unless they’re unusually muddy or something.
Just for gits and shiggles, I tried "I don my shoes." It is archaic/poetic, and it wasn't accepted. To don means to put on (some article of clothing), and to doff means to take it off. One doffs one's hat when entering a nice restaurant. Just wanted to share that bit of fun.
Wow fancy! I live in Minnesota and my carpet is dirty all winter until it gets cleaned in the spring. We wear boots (too cold anyway) so the boots come off and the shoes are carried in to visit someone else's home. My poor arches can't stand for me to be stocking footed and stand very long, but if I forget my clean shoes at a party, I'm stuck with that. Any party in Minnesota, winter or summer? Huge pile of shoes at the door because its the polite thing to do. I wear my shoes at my house all the time and tell people to keep their shoes on and they STILL take them off at the door. So, in the city it is engrained behavior. In the country, the work boots are clunky so most people change shoes to walk around indoors. We certainly started a shoe behavior discussion, didn't we?