This question lacks context but I will try to answer with what I can. When a poem juxtaposes, it places two different things side by side so you can compare and contrast, giving the poem an interesting effect. The poem might be suggesting that there are many similarities in the two subjects being juxtaposed as well as differences.
This is an example of a simile, a comparison between two things using the words "like" or "as." "Gloomy as the night" is the simile here, since his sadness is being compared to nighttime.