Figuring out how much rent you can afford is part math problem, part common sense. Here's how to do it, plus other costs you need to consider.