The PS5 measures 390 x 104 x 260mm (width x height x depth), but as Sony notes these figures exclude the largest projection and the base which is included in the box (for those who want to stand the console upright).
You'll want to make sure you have a few mm to spare all the way round to make sure it'll slide in, and to ensure air can get in and around to prevent any overheating issues.
If you're looking for something a little more streamlined, there's always the PS5 Digital Edition, which is an ever-so-slightly more svelte 390 x 92 x 260mm - again, excluding the largest projection and the base.