This is a great topic to explore in this story and to understand the answer to the question directly leads to understanding of the story as a whole. In several places in the story the narrator relates some detail, but then suggests that it may not have been real, thus creating a mysterious and ambiguous element. For example, when Goodman Brown first sees the Old Man with the walking stick he comments that the walking stick writhed like a snake, but then he immediately backs away from that statement saying, "it must have been an ocular deception." With this, he is leaving the idea open-ended. Was it real or not? Who knows. Another example is when he relates the scene of the witch meeting. He gives lots of great details, but then he continually questions exactly what he sees. He wonders if that person over there is his father; is that other one his mother? He never comes to a conclusion, so we are left to wonder who or what he is seeing. He frequently asks himself questions such as, "Can this be so?"
The ultimate point of the story is in the final section in the aftermath of the witch meeting. Even though Goodman Brown has saved himself and not joined the assembly, he is forever changed by the "experience," and at that point the narrator asks the most important question of the story: "Had Goodman Brown fallen asleep in the forest and only dreamed a wild dream of a witch-meeting?" (or had it all really happened). That is THE question of the story! But what is important to realize is that it doesn't really matter whether it happened or not because that night, real or not, changed Brown into a bitter and haunted man who can now only see and assume the worst in people after thinking he saw them all partaking in an evil scene. The ambiguousness of the story leaves the reader a bit frustrated, but Hawthorne's technique guarded against his audience thinking to themselves, "That could never happen, therefore it is stupid." Through the ambiguity, he actually makes it very clear that real or not, the experience matters very much, especially to Goodman Brown.