Context. Stars are born within dense clumps of giant molecular clouds, and constitute young stellar agglomerates known as embedded clusters, which only evolve into bound open clusters under special conditions. Aims. We statistically study all embedded clusters (ECs) and open clusters (OCs) known so far in the inner Galaxy, in particular investigating their interaction with the surrounding molecular environment and the differences in their evolution. Methods. We first compiled a merged list of 3904 clusters from optical and infrared cluster catalogs in the literature, including 75 new (mostly embedded) clusters discovered by us in the GLIMPSE survey. From this list, 695 clusters are within the Galactic range | | ≤ 60 • and |b| ≤ 1.5 • covered by the ATLASGAL survey, which was used to search for correlations with submm dust continuum emission tracing dense molecular gas. We defined an evolutionary sequence of five morphological types: deeply embedded cluster (EC1), partially embedded cluster (EC2), emerging open cluster (OC0), OC still associated with a submm clump in the vicinity (OC1), and OC without correlation with ATLASGAL emission (OC2). Together with this process, we performed a thorough literature survey of these 695 clusters, compiling a considerable number of physical and observational properties in a catalog that is publicly available. Results. We found that an OC defined observationally as OC0, OC1, or OC2 and confirmed as a real cluster is equivalent to the physical concept of OC (a bound exposed cluster) for ages in excess of ∼16 Myr. Some observed OCs younger than this limit can actually be unbound associations. We found that our OC and EC samples are roughly complete up to ∼1 kpc and ∼1.8 kpc from the Sun, respectively, beyond which the completeness decays exponentially. Using available age estimates for a few ECs, we derived an upper limit of 3 Myr for the duration of the embedded phase. Combined with the OC age distribution within 3 kpc of the Sun, which shows an excess of young exposed clusters compared to a theoretical fit that considers classical disruption mechanisms, we computed an embedded and young cluster dissolution fraction of 88 ± 8%. This high fraction is thought to be produced by several factors and not only by the classical paradigm of fast gas expulsion.