Structural arrest in chemical and colloidal gels