In practice, you just have to read off the answer from the society you find yourself in. For example, it is generally not considered okay to alienate yourself from people on the basis of race in the U.S.; although I have not experience it firsthand the accounts I read indicate that it is okay in Israel for not-particularly-religious arabs and Jews to segregate from each other.
(Religion is a particularly tricky case because people often do not behave in accord with what they profess to believe, so it often would come down to alienating someone because they have a different set of incorrect and non-predictive rationalizations for their behavior than you do...seen that way, deciding that alienation is rude sort of makes sense as a way to circumvent pointless animosity or lack-of-cooperation.)
But there is also the question of when it should be socially acceptable, which leads one to ask what social acceptance is good for anyway, and what our ultimate goals or moral principles are. Here, again, it really matters what those goals or principles are. For example, one could without much difficulty argue that a utilitarian should engage, not alienate, those with other viewpoints as the best way to get the other person to act in a way that maximizes whichever good that utilitarian is trying to maximize. (Actually, the answer would always be alienate or engage depending on whichever will result in the best outcome, as defined by said utilitarian.)
I'm not sure we know enough to make such decisions wisely, however. Studies of social shunning by individuals or groups are pretty few and far between; it's hard to know what the impact would be. Even principle-based systems of morality need to know the consequences of actions now and then.