It takes a certain amount of time (caused by a draught from an open window for example) for a weak or uneven flame to cause a candle to be guttered, therefore Holmes deduced that the window could not have been open long enough to produce such an effect.