To add onto the above post by Bomber, in an Inf Bn, you may have the caveat/probationary period of 'All new private to Bn need to live in the shacks for 6mon/1yr/etc'. This is to ensure that the new guys can make timings in Bn and also maintain their 'healthy eating' by being forced to eat at the mess for that time. When I got in (8yrs ago) this was the norm but if you had extenuating circumstances, you could write a memo to live off-base (have a family mainly). Once you passed your probationary period, you had to write a memo to your CoC stating where you plan to live, the approx time it took to get to work, how you will ensure you have transportation to the base, etc. Again, this is what I did in 2005 for my unit. Things are different now and appear to be a lot more relaxed. This can all change depending on who your CO is at your unit.
The CoC likely wants to ensure that you can get to work, that you won't live in the middle of nowhere a few hours away, that you can still meet your timings, you can still eat well, and are not moving away to save a few bucks. They will not want to hear of you living in a cardboard box and eating from a dumpster just so you can have the extra cash to gamble with at the casino.