Contrails are generated at jet exhaust and are thin clouds of water vapor. They are triggered by water vapor in the exhaust of jet planes and by the variation in the temperature and pressure at high altitudes.
Depending on changes in the temperature and pressure, these clouds last for only a short period or for hours at times. The duration of contrails is related to how fast these changes occur. If these changes are slow they last longer and if changes are rapid, they last for short periods.