A 2x4 can take anywhere from a few days to a couple of weeks to dry out completely. The time frame depends on how much moisture is in the wood, the temperature and humidity levels, and how well ventilated the area is. If you're trying to speed up the drying process, you can put the 2x4 in a sunny spot or use a fan to circulate air around it. Just be sure not to put it in direct sunlight, as that can cause the wood to warp.