when ... did; when ... happenedしたとき combines the past form した ("did") with とき ("time") and refers to the time when an action was completed. Depending on context, it can also mean "after doing ...". The form is neutral and can be used in both polite and informal sentences.
JA: 初めてキスしたときのこと、教えてよ。
EN: Tell me about the time you kissed someone for the first time.