As a strictly legal matter, you can withhold rent for any period of time that a home or apartment is not fit for occupancy. Safety issues, or lack of heating, stove, or other basic necessities are examples of when you can withhold rent.
On a practical level, however, it may be difficult to prove: 1) that the house was not safe, 2) that you notified your landlord, and 3) that you couldn't resolve the issue yourself. If you end up in court over a few weeks or a month of rent, it may cost you a lot more time and effort.
If you decide to withhold rent, then you should consider consulting an attorney, and documenting everything, including: keep a journal of conversations and events, follow-up any verbal conversation with a written letter, keep copies of bills, expenses, hotels, repairs, visits, etc.
The above is general advice and should not be relied on as legal advice or as forming an attorney-client relationship. You should consult directly with a competent attorney and provide details specific to your situation instead of relying on general advice.