Everything depends on specifics.
If it's something that Apple is obligated to fix under the terms of the warranty, Apple has the choice as to whether to repair or replace. Different problems have different solutions. Swollen batteries may bend the case, crack circuit boards... it's highly likely they'd replace the phone. For something like a bad power switch? Flip a coin!
They'll repair/replace if all three of these conditions are met:
1) It can't be fixed with software: reinstalling iOS, resetting settings, etc.
2) It's covered by warranty (defects in materials and workmanship)
3) There are no violations of warranty (no cracked screen, exposure to liquids, bent case, modification/unauthorized repair, blown up by the Mythbusters...)
Simple cosmetic wear-and-tear (scratches and small dents) generally does not violate the warranty, and is not likely to change Apple's approach to the repair.
The time it takes to repair depends on many things, including which country you're in (different options in different places) and what repair option you select (if there are options).
Fastest is usually if you can get yourself down to an Apple Store or an Apple-authorized repair shop. Often they can repair/replace it right then and there, maybe you'll have to wait a day or so.
In many places around the world, mail-in repair is the only solution. Turnaround time in that case is going to depend on shipping times. Add to that the time it spends in the shop - figure they won't look at your unit the same day they get it - possibly the next day (depends on how busy). So, if it takes 3 days (each way), plus 2-3 days in the shop... you can do the math.
In some countries they also offer express replacement - they ship out a replacement, you send the old one to Apple once you get the replacement. It costs extra unless you have AppleCare, and in all cases they'll put a "hold" on your credit card for the full retail price of the replacement (if you don't send the old unit to Apple, they'll charge you for the new one). Figure it'll take 2-3 business days for you to get the replacement. (If it turns out the problem was not covered by warranty, they'll charge you the regular repair price - they've already sent you a replacement, and already have your credit card.)
You have about two months remaining on your warranty. If there's something wrong that you think is covered by the warranty, then don't wait until the last minute.