銀行へ行くとき、カードを持っていきます。

とき can be used to say a general truth about when a certain action happens. This may be an action that is repeated any number of times.

銀行へ行くとき、カードを持っていきます。
When I go to the bank, I take my card.

It can be used with adjectives:

眠いときは早く寝ます。
When I’m tired, I go to bed early.

元気なとき、公園へ行きます。
When I’m feeling well, I go to the park.

and nouns

仕事のとき、いっしょけんめい働きます。
When I’m at work, I work hard.

As well as present-tense verbs, adjectives and nouns, とき can also be modified by past-tense verbs. Here, as we saw in the Structures section, the た ending of できた doesn’t mean that the first action actually happened in the past, but that it must be completed. The tense of the whole sentence is still determined by the sentence ending.

リポートができたとき、いつも部長に教えます。
When the report is ready, I always let the manager know.

辛いカレーを食べたとき、甘いアイスクリームが好きです。
After I’ve eaten a hot curry, I like ice cream.