Characters come from many places. Sure, they come from cities, countries, space and the sea, but where they come from before then is just as interesting. The idea for them is conceived from one of many inspirations: popular culture, our collective unconscious, personal unconscious projection and people we know. Knowing where a character concept came from can help us role-play it to it's full potential.
A frequent occurrence is when the characters we play in role-playing games are derived from pop culture. My brother's first character was as close to Tolkien's Legolas as the system would allow, which was quite near. An applicable term is stereotypes – a common understanding, true or false, about a particular person or character type. It's not difficult to envision a gruff dwarf with an axe; It makes for an easy concept to pull off at the table, too. Even when someone takes pains to operate against mainstream culture there will still be some amount of it left upon their characters. Archetypes such as these may appear in movies, books and even music.
On archetypes, there's another source we draw from and that's what C. G. Jung called the collective unconscious. Picture something in popular culture being so ingrained in every culture across time and space that they're available to people's memories despite lack of exposure to the concept. A couple of examples of this are a sun god or tricky jester. These archetypes will carry the same basic traits from one person to the next, no matter who portrays them. Jung's definition of these archetypes is that they stem innately into our subconscious and exist within everyone, no matter what. Characters modeled after any of these are similar to ones taken from pop culture because the individual puts their own twist on them. Characters pick up the player's traits in the specific manner the person expresses them in.
Both of the previous examples may be deliberate or not. Yet another place we draw from to create and portray characters resides in our unconscious. This area is highly personal, so much so that even we often don't know what's in there. A character concept drawn from here may seem to emanate from nowhere even while it fills a need for us, through projection. Simply stated: If we're holding something back about ourselves, from either ourselves or others, then whatever that is may emerge through role-playing and the creative portion of our brains. We role-players aren't alone in this, either; Authors may come to learn more about themselves through the characters they explore as well.
One final well we might delve into for character personalities is the people we know. Differentiate this from pop culture, I'm talking about our friends and adversaries in real life. While we probably do this on some level even without realizing it, we can consciously make characters to emulate either a person or a trait that someone might have. I've got a favorite example for this one: James Spackleson was a very blunt fellow and is my favorite opposite-to-me character yet. Opposite in the sense that I am not normally blunt. To my knowledge, this character didn't come from any source other than the blunt people I knew. In a sense, James Spackleson was me channeling my interpretation of those blunt individuals. Though it might be rude to role-play your friends in your next game, remember that mimicry is the sincerest form of flattery. Don't overdo it, though. Happy channeling!