I know a dog named Greta who squints with one eye because she has bad eyesight. Also I have a puppy who was hit with a stick in his eye and was squinting for a few days. If I were you I would watch him closely and see if he bumps into anything or how long he squints then if you have any info. And have access to a vet I would ask them.
He may have something in his eye or it may be scratched.
If he starts to act a little dazed or turns in circles towards his eye then it may be a brain tumor. Watch him very closely and report to a vet if there are additional symptoms.