The short answer
In the U.S., airlines aren't required by law to pay for a hotel, but the large ones have promised to when a delay or cancellation they caused strands you overnight. In Europe and the UK, the airline must provide a hotel for an overnight delay whatever the cause, even bad weather. In Canada, it must when the delay is within its control.
United States
Look up your airline on the DOT customer service dashboard. It shows which airlines promise a free hotel and ground transport for controllable overnight disruptions. Crew problems, maintenance and late planes count as controllable. Weather and air traffic control do not, so expect to pay yourself then; many airlines will still give you a discounted rate if you ask.
Europe and the UK
Under EU261 and UK261 "right to care", the airline must give you meals and drinks while you wait, and a hotel plus transport if you're stuck overnight. This applies even when the cause is outside its control, like a storm. If the airline doesn't arrange it, keep your receipts and claim the reasonable cost back.
Canada
For delays within the airline's control, Canadian rules require food and drink after 2 hours and a hotel with transport for overnight delays.
What to say at the desk
Ask for the next seat first, then the hotel and meal vouchers, and name the reason they gave you. Our stranded checklist writes a short script for your situation.
If you have to book it yourself
Rooms near the airport go fast during big disruptions, so book one with free cancellation before you queue. Check live delays at your airport to see if it's worth waiting.