The diatomaceous earth can be left on the carpet for as long as you want. It will work as long as it is kept dry, and it usually takes a week or more before it starts to kill the insects. Since the insects could have laid eggs by that time, leaving the diatomaceous earth out for several weeks may help avoid a resurgence.