Like most things in life, it depends.
If your goal is a cheap flight, I believe you're more likely to save money by booking in advance during a non-peak season to lock in a good price.
Airlines are pretty smart these days at filling their planes full of passengers.
Demand from last minute bookings usually leads to demand exceeding capacity - meaning airlines will tend to charge more.
Source: Booking many business flights (including a $3k last minute flight from NYC to Singapore).