Basically, nakama 仲間 means the people around you. The people you trust. The people you live with, the people you commute with, that you work, that you study with, etc.
In shounen anime, manga, and games, that would be the people in your "party" that would go around battling monsters, saving the world and stuff. Practically everybody around you that's together with you that you can trust is your nakama.
- nakama nanoni uragitta 仲間なのに裏切った
[He] betrayed [me] even though [he's] nakama.
Nakama in Games
It is very important to note that the word nakama is not really common outside the anime scene. In anime, it's common to have a "party," because in RPG games, it's common to have a "party." And a "party" in an RPG game in Japanese is called... guess what? Yep, an RPG party is nakama in Japanese.
In Japanese games, nakama ni kuwaeru 仲間に加える would be to "join [one's] party." I don't need to say that this is strictly game lingo. People don't "join" other people's nakama in real life just by pressing the A button.
Kanji of Nakama
The kanji of the word nakama 仲間 also sort of shows its true meaning. The naka 仲 part means "relationship" while the ma ma 間 part means "span" in the sense of "space." So nakama 仲間 is literally an "area of relationships," or, in other words, your circle of friends.
- naka ga ii ne 仲が良いね
[They are] good friends, right?
(lit.: the relationship is good)
Since nakama is like a "circle of friends," that explains why we can say "you are nakama," "you are my nakama" and "we are nakama." If you are in my nakama, I'd be in your nakama, too, right? Thus we'd be nakama.
This confusing mess feels like adding friends in Facebook, being followers on Tumblr, or being watchers in DeviantArt.
Another way to think of nakama is the people you hang around with. Since you are always together, having fun and stuff, you are nakama. Congratz.
Nakama vs Tomodachi
One last point I want to bring up is the difference between nakama and tomodachi 友達, since it's very obvious someone out there is asking themselves that.
The word tomodachi means "friend," but it sounds like something a child would say so people tend to avoid talking about their relationships (naka 仲) using the word children use to talk about themselves.
Even if you were to introduce someone somewhere, it'd be easier to say shiriai 知り合い, "someone you know," or douryou 同僚, "someone you work with," or just saying nothing than saying "hey guys, this is mai friiiiiiend!"
So with that said, the idea is that though they are more or less the same thing, the word tomodachi is more childish while nakama is more teen level. It's like "friends" vs. "colleagues."
Another way to look at it is, if there was an article for bullied kids, it would ask if they had someone they could call a friend, tomodachi, but an article for depressed suicidal teenagers would ask if they had someone they could call nakama. Weird example, but that more or less sums it up.