Pulsar timing arrays offer a probe of the low-frequency gravitational wave spectrum (1 - 100 nanohertz), which is intimately connected to a number of markers that can uniquely trace the formation and evolution of the Universe. We present the dataset and the results of the timing analysis from the second data release of the European Pulsar Timing Array (EPTA). The dataset contains high-precision pulsar timing data from 25 millisecond pulsars collected with the five largest radio telescopes in Europe, as well as the Large European Array for Pulsars. The dataset forms the foundation for the search for gravitational waves by the EPTA, presented in associated papers. We describe the dataset and present the results of the frequentist and Bayesian pulsar timing analysis for individual millisecond pulsars that have been observed over the last ~25 years. We discuss the improvements to the individual pulsar parameter estimates, as well as new measurements of the physical properties of these pulsars and their companions. This data release extends the dataset from EPTA Data Release 1 up to the beginning of 2021, with individual pulsar datasets with timespans ranging from 14 to 25 years. These lead to improved constraints on annual parallaxes, secular variation of the orbital period, and Shapiro delay for a number of sources. Based on these results, we derived astrophysical parameters that include distances, transverse velocities, binary pulsar masses, and annual orbital parallaxes.