Her dream could mean that she's been having doubts about the relationship, but then I doubt she'd have told you if that was the case. It's more likely that she felt bad about the content of her dream, and confessed in order to ease her guilt.
However, it is possible (but not likely) that she told you in order to gauge your reaction and find out how you'd cope if she actually did leave you.
Dreams about cheating on or leaving a significant other are not usually associated with an actual desire to betray or abandon them; in fact, these dreams are more often interpreted to symbolise feelings of self-betrayal or self-doubt. Maybe your girlfriend is facing some internal conflicts of her own right now.
Your girlfriend could be thinking of leaving you for someone else, and her dream could just be a manifestation of this desire. Fortunately, I don't think she'd have told you about the dream if this was the case, so she probably has no such intentions!