"Where were you yesterday afternoon?"
"le" is generally used to indicate the completion of a verb or it can go after an adjective and sometimes also a verb to indicate a change in state.
basically 了 is used to show the change of state
下雨了 - "it rains" it wasn't raining before, but now it is - the state has changed
also sometimes works like past tense marker
我昨天买了三个苹果 -"I bought three apples yesterday"
(bare in mind that is how I understand that)
You are correct in that one of the uses of 了 is to show a change in state, like the example you mentioned. To expand on 了 being kind of like a past tense marker (although that's not what it's for), 了 can also be used after a verb or adjective to indicate completion.
"了" isn't used after "在" because "在" is a "to be" verb, only with respect to where something is located. "在" is used to indicate the state of being located somewhere. The action of a "to be" verb is ongoing and as such, cannot be completed since it's generally used as a passive voice verb. When deciding when to use "了", when indicating the completion of a verb, make sure the verb is an active voice verb.