The sooner the better.  A new deck will begin to discolor in  as little as two weeks when  its exposed to the sun.  If pollen spores settle into the grain of the wood, they can become a food source for mold or mildew.  Staining and sealing the wood will help  protect it from the elements.  When protecting new wood for the first time it is usually best to clean and brighten the wood prior to applying any finish.