There are two sentences below
- He gazed out the window.
- He gazed out of the window.
What is the difference between the two expressions in meaning? Please, tell me.
There is very little difference; one of them has a more formal register than the other.
In Britain, we normally use the preposition phrase "out of", and that's accepted in formal English. In informal use, some dialects regularly omit the "of", and it is understood in context. I don't recommend this form when you are writing.
Other regions appear to have this distinction reversed.
As an alternative, you could also consider, "He gazed through the window", but that is slightly different, as that can mean gazing in to rather than out of.