generally the sooner you buy tickets, the cheaper... there are 21-day, 14-day, and 7-day advanced fares... more than likely, anything inside of 7-days will be very expensive... but this structure isn't necessarily always the best deal... there are some restrictions, e.g., must stay over saturday night for domestic travel and 6-night stay for int'l travel, etc...
alternative 'good deals' might include sales, e-fares, and other specials... e-fares are restrictive in terms of dates & length of travel, e.g., must depart sat and return next mon or tues.... but can be a good deal as the airlines try to sell empty seats at the last minute... int'l e-fares are usually 6-7 day trips...
there are seasonal airfare sales... e.g., the first part of january usually brings sales... so does the first quarter of the year... there are some summer sales... some of these are destination dependent... e.g., north asia is cheaper during the winter... while south-east asia is more expensive during the cold months... also london is very reasonable during the winter...
and lastly, vacation package deals are worth investigating for airfare... safe travels.