It is recommended to book your weekend getaway from San Francisco at least a few weeks in advance to secure accommodations and get the best deals, especially during peak travel seasons. This allows you to have more options and increases the likelihood of finding available rooms or vacation rentals.