Once an inchworm gets into it's protective cocoon the inchworm will stay in their cocoon for 5 to 21 days.
When they are done being in their cocoon the inchworm will then turn into a moth just like a regular caterpillar will turn into a butterfly.
The longest though that an inchworm stays in it's cocoon is 21 days but usually they will emerge from their cocoon within 21 days and become a moth.
Inchworms also are not really worms at all even though they are called inchworms but instead the inchworms are actually a type of caterpillar just like butterflies come from caterpillars the moths which are a type of butterfly they also come from inchworms.
Inchworms are also not harmful to humans or animals but they are harmful to plants and trees so if you have a garden that you want to keep the inchworms out of you may need to use some pesticides.