We report a combined experimental and theoretical lattice dynamics study of the Ruddlesden-Popper layered compound Sr2TiO4. From inelastic neutron scattering experiments we derive the generalized phonon density of states of Sr2TiO4. We also report its heat capacity, thermal expansion and the thermodynamic Grüneisen parameter using the calculated bulk modulus and find a large value of about 2. Using Raman scattering experiments under pressure, we discuss a probable structural distortion of the tetragonal structure above 11 GPa which could be due to non-hydrostatic compression. The mode Grüneisen parameters of the four Raman-active modes are determined and shown to be in reasonable agreement with those obtained by DFPT calculations. The temperature behavior of the Raman-active modes was studied, allowing us to determine the implicit volume and explicit anharmonic contributions. Above 400 K, the implicit volume contribution dominates the temperature-induced variation of the four Raman-active modes, whereas below this temperature, the explicit anharmonic contribution is the dominant contributor to the highest energy mode. Our results underline the importance of the anharmonicity in vibrational-related properties of Sr2TiO4.