When you have a specific date/time in mind. For example, if you want to travel on November 15th from San Francisco to New York City and return on December 1st, it is best to purchase your tickets as soon as possible. Make sure the dates are flexible so that they don’t need to be changed. Also, try not to book too far ahead of time because airlines tend to raise prices when they know there is low demand for planes. If all else fails then go with a “quick-buy” option like Expedia or Priceline which allows you to buy an airline ticket any time within 24 hours (you can still change your date).