V1 dic. 時 indicates a time before the action represented by the verb (V1) is completed or started. The action represented by V2 occurs before the action represented by V1 takes place. V1 た 時, on the other hand, indicates a time when the action represented by the verb (V1) is complete. V1 takes place before V2.
ビザを とる時、大使館に 行かなければ なりません。
We have to go to the embassy when getting a visa.
駅を 出る時、駅員に きっぷを わたします。
When we exit a railway station, we give/hand our ticket to a station employee [ticket collector].
よる、人と 会った時、「こんばんは。」と あいさつを します。
We say "Konbanwa" when we meet someone at night.
Note that the subject in the subordinate clause is marked by が, not は:
わたしが 入院する時、母は とても 心配しました。
When I was to be hospitalized, my mother was really worried.
わたしが 元気に なった時、母は 安心しました。
When I got well, my mother was relieved.