It depends, the agent you speak to decides. Due to the amount of appointments not all passports can be made same day at the agency. They will do there best to accommodate you but it's based on how far you traveled and when you are leaving. If it is possible to mail it to you before your trip, it will most likely be mailed.
I had my appointment on 8/2. Came back to pick up my passport on 8/4. They offered to mail it if I wanted. You should be fine with your timeline.
Thanks! Your answer is awaiting moderation.