We present a quantitative analysis of Selberg's trace formula viewed as an exact version of Gutzwiller's semiclassical periodic-orbit theory for the quantization of classically chaotic systems. Two main applications of the trace formula are discussed in detail. (i) The periodic-orbit sum rules giving a smoothing of the quantal energy-level density. (ii) The Selberg zeta function as a prototype of a dynamical zeta function defined as an Euler product over the classical periodic orbits and its analytic continuation across the entropy barrier by means of a Dirichlet series. It is shown how the long periodic orbits can be effectively taken into account by a universal remainder term which is explicitly given as an integral over an `orbit-selection function'. Numerical results are presented for the free motion of a point particle on compact Riemann surfaces (Hadamard-Gutzwiller model), which is the primary testing ground for our ideas relating quantum mechanics and classical mechanics in the case of strong chaos. Our results demonstrate clearly the crucial role played by the long periodic orbits. An exact rule for quantizing chaos is derived for such systems where the Dirichlet series representing the Selberg zeta function converges on the critical line. Explicit formulae are given for the computation of the abscissae of absolute and conditional convergence, respectively, of these dynamical Dirichlet series. For the two Riemann surfaces considered, it turns out that one can cross the entropy barrier, but that the critical line cannot be reached by a convergent Dirichlet series. It would seem that this is the main reason why the Riemann-Siegel lookalike formula, recently conjectured by M. V. Berry and J. P. Keating, fails in generating the lower-lying quantal energies for these strongly chaotic systems.