There is a pessimism that runs throughout the novel but there are moments when the mood is optimistic or at least positive. However, even when positive moments are presented, they are often supplemented or balanced by a pessimistic mood. For example, in Chapter 5 when Gatsby finally reunites with Daisy and they embrace, there is a sense of loss as much as there is a sense of gain. Nick notices that Gatsby has changed, first for the better:
But there was a change in Gatsby that was simply confounding. He literally glowed; without a word or a gesture of exultation from him a new well-being radiated from him and filled the little room.
As with any great project or journey, when the goal is reached, there is a sense of loss in that the journey is over. But the loss in this case also carries a bit of disappointment because Gatsby had idealized Daisy (his American dream) so much that he was bound to be a bit let down. In the last few paragraphs of Chapter 5, Nick contemplates this.
As I went over to say goodbye I saw that the expression of bewilderment had come back into Gatsby's face, as though a faint doubt had occurred to him as to the quality of his present happiness.
This technique of juxtaposing the beauty of the American dream with the failure of it also recurs throughout the novel. This suggests that the American dream is flawed, not available to everyone, and/or achievable only through dubious efforts. At the beginning of Chapter 2, Fitzgerald describes the grotesque valley of ashes and this follows the end of Chapter 1 which leaves the reader with Gatsby's symbol of the American dream, the green light. So, the transition from Chapter 1 to Chapter 2 goes from hope, light, and life (associations with green) to one of hopelessness, notably with the valley of ashes and George Wilson himself.
The valley of ashes is bounded on one side by a small foul river, and when the drawbridge is up to let barges through, the passengers on waiting trains can stare at the dismal scene for as long as half an hour.
Also consider that those who are successful (at least financially) are corrupt or unethical: Wolfsheim, Tom Buchanan. Even Gatsby has had to participate in illegal activities to achieve his wealth.