Wood need to be as dry as possible before staining. Usually 24 hours of good dry weather is enough to remove any excess moisture. But, it all depends on the temperatures and humidity. You can check the 'wetness' of a surface by using a moisture meter. These meters are very cheap and do a good job letting you know that the surface is too wet.