A brief summary of the endings. The Bad Ending is obtained by running out of time during the fight with White Reimu.
Bad Ending: Marisa wakes up it was all a dream.
Good Ending 1: Marisa learns that she too is not of Gensokyo. Reimu's dream is being shared by her and both are about to wake up now. In the last moments of Gensokyo, Alice and the others bid Marisa to never forget about them.
Good Ending 2: Marisa and Reimu wake up in a hospital, in the same room. Marisa gets Reimu to admit that they both dreamt of a place called Gensokyo.