There are the following two expressions in Japanese.
ここに来た時
ここにきたとき
Actually, the usage of this is ambiguous even for Japanese people, but there is a clear difference between the two.
"時" represents a clear time

"時" is used to represent a clear time.
Sentences that are expressed using "時".
・ Customers must disinfect when they come here.
・ When I come here, I usually order beer
When talking about clearly separated times, use the kanji "時".
"とき" represents an assumption (case classification).

・ Let's talk when Mr. A comes here.
In the sentence, two patterns are assumed, one is "come" and the other is "not come". It is used to mean when ⇨ when. Therefore, "when you come" can be rephrased as when you come.
Summary
This article is not well understood by Japanese people. It was the proper use of "time" and "time". When writing a sentence, if you can write it carefully so as not to be confused, there is no doubt that it will be noticed by others.