Two weeks unless close to winter then they will almost hibernate until spring.
According to what I have read online, a couple weeks is typical.
Until it leaves
The Cinnabar Moth will stay in their cocoon for a period of nine months. They cocoon themselves in the early summer and do not emerge from the cocoon until the next spring.
1 week
The Spotted Apatelode Moth goes through complete metamorphosis. It takes a little more than two weeks for the moth to reach the cocoon stage.
A caterpilar lives in a cocoon to turn into a buterfly a moth
5 ~ 6 weeks
Silk fibers are obtained from the cocoon of silk larvae, larvae of the silk moth, which are spun from the cocoon into one, long thread.
egg, catterpillar, cocoon, moth
Case Moth/Bag Worm/Bag Moth (Psychidae). The cocoon or case is mobile. The caterpillars are leaf miners when they are very small and may take several years before they come to the pupate stage. If it is a female, it will not develop wings and will never come out of the bag. It waits for a winged male in her bag.
Well it depends what kind of yellow caterpillar you are talking about, if the one you are suggesting about is the size and thickness of your thumb, then yes it is, it's proper name is a "Polyphemus Moth Caterpillar". Polyphemus eat maple, birch, willow and several other trees, but are seldom abundant enough to cause any damage. As big as they are, they are really hard to see among the foliage when they're resting. As with many caterpillars that leave the food plant to spin a cocoon, Polyphemus are sometimes seen wandering around in late summer. This caterpillar spins a tough, brown, oval cocoon that you may find attached to the eaves around your house during the winter.
There are several different plants that a Polyphemus moth will feed on. Some of these plants include Pyrus, Sassafras, Citrus, and Ulmus Americana.
A silkworm comes out of the silk cocoon as a moth, if its life is allowed to complete a full cycle.
The accepted scientific name is Antheraea polyphemus.