Which grammar rule (if any) applies to the phrase 'I like it when you smile.'

Solution 1:

We cannot say 'I like it how you talk, or 'I like it where you go.' because “to like” requires only one direct object.

An object should be a substantive (a noun or pronoun or something similar that can be the subject of a verb)

In “I like it when you smile”, “when you smile” is not a substantive.

The verb “like” therefore requires an object.

So that it can have an object, “it” is used as a dummy object†.

In “I like it how you talk”, and 'I like it where you go.', “how you talk”, and “where you go” are both noun clauses and noun clauses are substantives††. They are therefore, respectively, the objects of the verb “like”.

Unfortunately, there is an “it” in both sentences, and “to like” cannot have two direct objects, so you must omit “it”:

“I like how you talk”, and 'I like where you go.' – These are correct.

† See https://www.thefreedictionary.com/Dummy-Pronouns.htm

†† we can show they are substantives as they can be the subject of a verb: “How you talk is an indication of where you are from” and “Where you go depends on whether you are walking or driving.”

Solution 2:

How = the way that; where = the place at/in which; when = the time at/on which; why = the reason for which.

How, when, where, why are adverb words. Convert them into noun phrases like above if the object of a verb is a free relative clause containing any one of them. A free relative clause is a relative clause used like a noun.

So, your examples:

I like how you talk = I like the way that you talk (makes sense).

I like where you go = I like the place at which you go (makes sense).

'how you talk' and 'where you go' are free relative clauses in the object position.

I like when you talk = I like the time at which you talk (doesn't make sense) (you don't really like the time, do you?)

I like it when you talk = I like it at the time at which you talk. (makes sense). Here, when = 'at the time at which' is a conjunction and the clause 'when you talk' is an adverbial clause of time.