When I play (which is rarely), I usually balance concept and rules until I come with something that satisfies me in both. I might be thinking about clerics because the party needs one, then come up with a roleplay hook that would make a good cleric and take it from there. From there usually means thinking up a basic history while doing the stats, then fleshing out the history (making minor changes to the stats as needed). Since I don't play very often, I tend to put way too much thought into my PCs.
When DMing, I have two types of NPCs: mass-produced and custom-made. Custom-made NPCs are the big villains, major henchmen, etc., and are usually built around some sort of hook, either roleplay or game mechanic. Once I have the hook, I'll make them as I make PCs, more or less. Mass-produced NPCs are for when I'm populating a town or something similar; usually I'll create a big list of names and just bang out a paragraph of description and background for each. Long repetition of this process has made me pretty quick at it, and I find it a great way to come up with plot seeds, backstory, and secondary intrigues as I go. By making them all at once, it's easier to create relationships between them.