All throughout my childhood I thought "virgin" meant spontaneously becoming pregnant! (My only exposure to the word was in the context of the virgin Mary-- understandable, I suppose, seeing as I have a pastor for a dad.) I didn't learn until high school what it really meant. XD
In any case, I think virginity is a really arbitrary concept. I mean, what defines honest-to-goodness, virginity-losing sex from "sexual things that aren't really sex?" I've done the same general things with two different partners, but with one it was clearly intended as experimentation and didn't feel like sex at all, while the other it was clearly intended as sex and very much felt like it. I can't draw a clear line where I "lost my virginity."
For some people, sex is a big deal. For others, it's not. It's a personal thing and not the same for everyone. (For me, personally, I think sex is a big deal but virginity and the loss thereof is not.) Regardless, though, the most basic things to take into account are, "Are you being safe?" and "Do you feel comfortable?" Also, like a few other people have said, it does help if you know and are comfortable with the person (whether romantically or as a friend)-- especially the first time or few times. It's not a necessary prerequisite by any means, but it is helpful for preventing future regrets as well as potentially dangerous/uncomfortable situations.