Before he is wounded, Frederick is indecisive about Catherine and is primarily interested in her due to his attraction to and lust for her. He admits early in the novel to not loving Catherine truly, acknowledging to the reader that he's told women before that he loved them but that it was always because of lust—never the heart-felt, kindred-spirits kind of love that others describe to him.
However, while called up to the front with the ambulance brigade, Frederick is wounded in an enemy artillery strike and is rushed to a hospital, where he is cooped up for weeks and has time to reflect. He ponders the war and what his life might be if not for it, and he fantasizes about having a life with Catherine. Upon Catherine's transfer to the hospital to be near him, Frederick is overcome and experiences a moment of epiphany: he realizes that he does love Catherine, or does in that moment. It is then that Catherine and Frederick take up a passionate and steady romance in a string of late-night trysts that are always in the dark.
While at first he is ambivalent, Frederick does come to love Catherine intensely and, as another Educator noted, turns out the light before saying goodbye, a nod to the nights spent together in the darkness of the hospital where their love was first truly realized.