We describe an unambiguous gravitational-wave signature to identify the occurrence of a strong phase transition from hadronic matter to deconfined quark matter in neutron star mergers. Such a phase transition leads to a strong softening of the equation of state and hence to more compact merger remnants compared to purely hadronic models. If a phase transition takes place during merging, this results in a characteristic increase of the dominant postmerger gravitational-wave frequency relative to the tidal deformability characterizing the inspiral phase. By comparing results from different purely hadronic and hybrid models we show that a strong phase transition can be identified from a single, simultaneous measurement of pre- and postmerger gravitational waves. Furthermore, we present new results for hybrid star mergers, which contain quark matter already during the inspiral stage. Also for these systems we find that the postmerger GW frequency is increased compared to purely hadronic models. We thus conclude that also hybrid star mergers with an onset of the hadron-quark phase transition at relatively low densities may lead to the very same characteristic signature of quark deconfinement in the postmerger GW signal as systems undergoing the phase transition during merging.