ANSWER: It can mean both.
잠자리 can mean either bed or dragonfly, so, in written Korean, a person would need to see the word used in the context of a sentence to determine its intended meaning. However, in spoken Korean, a person should be able to determine the meaning of the word by its pronunciation. When 잠자리 is pronounced /잠자리/, it means dragonfly, but when it is pronounced /잠짜리/, it means bed or sleeping place.
The 잠자리 meaning dragonfly is considered a base word, but the 잠자리 meaning bed is considered a compound word since it is made from two Korean nouns: 잠 meaning sleep and 자리 meaning place.