There is no hard and fast rule that applies equally across the CF. It's all trade and element dependant, also whether you're an NCM or an Officer. I was free to move out as soon as I was done SLT, I stayed in shacks for the first 5 years I was in since it was cheap and allowed me to afford a brand new car.
If you're talking about "I'm from Toronto and I'm posted to Halifax" then you wouldn't live in Toronto anymore and you could either buy, rent or live on base in Halifax as I stated above. Joining the Reg force will 99% of the time mean that you're no longer within driving distance of mommy and daddy, get used to the idea.
And as the other guys said, nothing is free. It comes right off your pay if you're living in military housing (singles quarters aka shacks aka barracks, or PMQs).