I’m including a link to a resource that may break this question down a bit better but, in essence, yes, squats can make you shorter just not by much. In the article, they mention that you want to combine squats (or any movement that puts a load on the spine) with flexibility and stretching movements so as to reverse the effects of the load. They also mention that, from a study they’d done themselves, squatting doesn’t take much more than 4 cm off of the height of men who do it on a regular basis (4 cm is the size of a sesame seed).
For more you can check out this resource. It’s full of visuals and other things that may help you gain a better understanding of my answer.