Quantum phase transitions (QPTs) involve transformations between different states of matter that are driven by quantum fluctuations1. These fluctuations play a dominant part in the quantum critical region surrounding the transition point, where the dynamics is governed by the universal properties associated with the QPT. Although time-dependent phenomena associated with classical, thermally driven phase transitions have been extensively studied in systems ranging from the early Universe to Bose-Einstein condensates2-5, understanding critical real-time dynamics in isolated, non-equilibrium quantum systems remains a challenge6. Here we use a Rydberg atom quantum simulator with programmable interactions to study the quantum critical dynamics associated with several distinct QPTs. By studying the growth of spatial correlations when crossing the QPT, we experimentally verify the quantum Kibble-Zurek mechanism (QKZM)7-9 for an Ising-type QPT, explore scaling universality and observe corrections beyond QKZM predictions. This approach is subsequently used to measure the critical exponents associated with chiral clock models10,11, providing new insights into exotic systems that were not previously understood and opening the door to precision studies of critical phenomena, simulations of lattice gauge theories12,13 and applications to quantum optimization14,15.