As "when", 当 sits at the start of a clause and pairs with 的时候 at the end, framing the time-span explicitly. More formal than a bare 的时候 clause without the opening dāng marker.
mistakes
Don't confuse 当 (1st tone, to be / when) with 当 (4th tone, to regard as / to pawn / suitable). Compounds split clearly: 当然, 当时, 应当 all use dāng, while 适当, 当作, 上当 use dàng.
Bottom 彐 is the indexing radical. In traditional 當 the lower portion was 田 (field); the 1956 simplification redrew it as 彐, and modern indexing follows the new shape, filing 当 under the snout radical rather than the historical field one.
Top three strokes are the ⺌ small-crown form, here a stylised reduction of the traditional 尚 top. They sit on the 彐 base as a decorative cap; the original 當 had 尚 above 田 (field), both simplified into this compact silhouette.