Subspace methods are commonly used for finding approximate eigenvalues and singular values of large-scale matrices. Once a subspace is found, the Rayleigh-Ritz method (for symmetric eigenvalue problems) and Petrov-Galerkin projection (for singular values) are the de facto method for extraction of eigenvalues and singular values. In this work we derive quadratic error bounds for approximate eigenvalues obtained via the Rayleigh-Ritz process. Our bounds take advantage of the fact that extremal eigenpairs tend to converge faster than the rest, hence corresponding to smaller residuals. The bounds are of the form c x (i-th residual)^2/gap_i, where gap_i is roughly the gap between the i-th Ritz value and the eigenvalues that are not approximated by the Ritz process, and c> 1 is a modest scalar. Our bound is well adapted to each Ritz value and is robust to clustered Ritz values, which is a key improvement over existing results. We show that the bound is asymptotically sharp, and generalize it to singular values of arbitrary real matrices. Finally, we apply these bounds to several methods for computing eigenvalues and singular values, and illustrate the sharpness of our bounds in a number of computational settings, including Krylov methods and randomized algorithms.