This always seems to be a problem I have. When I meet new people, I'm never really sure when's the right time to mention the fact that I'm gay. Like, I've met some homophobic people before (who I'm not out to even now), who I would never have been friends with, probably, if I'd come out to them early on. I know that it's better not to be friends with people who don't love you for who you are, but they're people who I legitimately like and get along with really well. And at this point it's impossible to just casually bring it up in conversation. So is it better to say it way before, like within the first week of knowing someone?
You say it when you think it's warranted, but honestly I don't see a need to wear it on your sleeve to the point where you introduce yourself as "Hi, I'm snowflurry, and I'm gay." Judge the situation and gauge appropriately. I have a lot of friends I don't even talk about sex and such with; to them, who I am means nothing, so I would say if it's not relevant to the discussion at hand or the friendship, no need to "lead" with it. Good luck!
Well, you could always say, "Hi, I'm [name] and I'm gay." Personally, I don't like that because it makes it seem like it's one of your biggest indicators which I don't agree with. Another way to mention it is when something even remotely related to your sexual orientation comes up, say something. If a new guy says, "I wish I had a girlfriend." say, "Me too!" Make it known without throwing it at people. Good luck.
It's definitely a hard thing to gauge, and I think everyone will have different opinions on it. For me personally, I wouldn't lead with it. I'll wait maybe a couple weeks in, or whenever the topic happens to come up, then bring it up casually. Psychology says that people will be more likely to change their views if they have some sort of friendship investment with you, so while I might not change every homophobe's mind, I might change a few. All that said, the people I tend to hang with aren't exactly the closed-minded people who'd hate on gays anyway. Telling them early does have the advantage of avoiding any potential confrontation later though, as you said. But I think that having to make that announcement reinforces the idea that being gay can be a big deal, when it really shouldn't be.
I would suggest letting them know as soon as possible ONLY if the conversation is travelling in that general direction. I wouldn't suggest bringing it up randomly, for the same reason King said. If the person you're talking with assumes you're straight and asks if you have a boyfriend, just casually say, "Actually, I'm a lesbian." I barely have any experience with this but once I'm fully out I'll tell people I meet as soon as I can.