Like most other bugs, their "adult" reproductive phases are usually brief - a week or two. However, their time as eggs, larvae (in this case, caterpillars), and pupae varies depending on species and climate.
Some even migrate (eg Monarchs) and some, like Mourning Cloaks, (photo) hibernate, which is why you sometimes see them fully-fledged on the first warm days of Spring. Tough buggers, live on tree sap.
How long do butterflies and moths live?
How Long Do Butterflies Live?
How Long Do Butterflies Live?