Most people, I think, and including a substantial fraction of lesbian, gay, and bisexual people, equate sexuality too closely with sex. This is particularly vexing when it comes to dealing with the straight majority, sometimes even the most well-intentioned among them.
There is certainly no great unanimity of opinion on this point among LGB people I know, but to state plainly the only principle that makes any sense to me: your sexuality is about the genders of the people you love; it is not about the genders of people you have sexual relations with. There are, to be sure, various kinds of love, and that has be taken into account. We're talking not about the kind of love one feels family members or old friends, but rather about the people you fall in love with.
Sleeping with (having sex with) another man does not make a man gay. For one thing, if it did, the fraction of the male population that's gay would be more like 40% than 5%, because lots and lots of straight men have had sexual relations with other men during their lives. And bisexuals wouldn't even exist, since they by definition have affective relationships with both men and women.
On the other hand, I know plenty of gay men who would vehemently disagree with me in whole or in part about this; they are of the opinion that any so-called straight man who has sex with another man is either gay or bisexual and just not admitting or coming to terms with it. My quarrel with that point of view is that it relies on the partner's gender alone to categorize him. I've had sex with too many straight men -- undeniably straight men who loved women and women only -- to believe this "gender tells the story" concept.
The story is further complicated by the fact that huge numbers of people don't have sex at all, and some are even virgins (what a word!) all their lives. But I feel fairly certain everybody has sexuality among their qualities.
My rule is very simple, really: it's who you love romantically, not who you have sex with. Sex and love are not fully mutually exclusive, of course, and in addition our society has major problems with sex and sexuality more generally. But none of this compromises the rule.