Generalized dimensions of multifractal measures are usually seen as static objects, related to the scaling properties of suitable partition functions, or moments of measures of cells. When these measures are invariant for the flow of a chaotic dynamical system, generalized dimensions take on a dynamical meaning, as they provide the rate function for the large deviations of the first hitting time, which is the (average) time required to connect any two different regions in phase space. We prove this result rigorously under a set of stringent assumptions. As a consequence, the statistics of hitting times provides new algorithms for the computation of the spectrum of generalized dimensions. Numerical examples, presented along with the theory, suggest that the validity of this technique reaches far beyond the range covered by the theorem. We state our result within the framework of extreme value theory. This approach reveals that hitting times are also linked to dynamical indicators such as stability of the motion and local dimensions of the invariant measure. This suggests that one can use local dynamical indicators from finite time series to gather information on the multifractal spectrum of generalized dimension. We show an application of this technique to experimental data from climate dynamics.