From my experience it's totally unpredictable. I've found that if I get upgraded it's usually between two and four weeks before departure. I was upgraded on a flight that appeared almost full in First when I checked only to find a total of 4 people in F when I boarded. Similarly a flight may appear wide open a two weeks before departure and yet no upgrade is available. As DYKWIA says, the best is to keep checking on a daily basis.