A vast number of different neuronal activity patterns could each induce a different set of activity-regulated genes. Mapping this coupling between activity pattern and gene induction would allow inference of a neuron's activity-pattern history from its gene expression and improve our understanding of activity-pattern-dependent synaptic plasticity. In genome-scale experiments comparing brief and sustained activity patterns, we reveal that activity-duration history can be inferred from gene expression profiles. Brief activity selectively induces a small subset of the activity-regulated gene program that corresponds to the first of three temporal waves of genes induced by sustained activity. Induction of these first-wave genes is mechanistically distinct from that of the later waves because it requires MAPK/ERK signaling but does not require de novo translation. Thus, the same mechanisms that establish the multi-wave temporal structure of gene induction also enable different gene sets to be induced by different activity durations.