We present an textit{ab initio} study based on density-functional theory of first- and second-order Raman spectra of graphene-based materials with different stacking arrangements and numbers of layers. Going from monolayer and bilayer graphene to periodic graphitic structures, we investigate the behavior of the first-order G-band and of the second-order 2D-band excited by the same set of photon energies. The former turns out to be very similar in all considered graphene-based materials, while in the latter we find the signatures of individual structures. With a systematic analysis of the second-order Raman spectra at varying frenquency of the incident radiation, we monitor the Raman signal and identify the contributions from different phonon modes that are characteristic of each specific arrangement. Supported by good agreement with experimental findings and with previous theoretical studies based on alternative approaches, our results propose an effective tool to probe and analyze the fingerprints of graphene-based and other low-dimensional materials.