During the summer, the air is significantly more humid and the humidity causes the wood trim to swell. In the winter, the air is dryer and it takes the moisture away from the wood, causing the trim to contract. If you installed your upper wall trim during the summer, when the air was humid, the cold weather has caused the wood to contract, pulling it away from the ceiling.
Leave the trim in the room where it is going to be installed for two days to a week before you begin your work to ensure that it swells or shrinks accordingly; the conditions where the trim was previously kept are likely very different from the environment of your home. If you want to prevent the wall trim from pulling away from the ceiling in future installations, wait for a cold, dry winter day to install your trim.
Do not attempt to fill the gap between the ceiling and the upper wall trim using spackle or any other type of rigid filler. The filler adheres to ceiling and the trim, but it will not expand and contract the way the wood does. Instead, it resists the motion of the trim, and over time, this can create cracking to the trim and the finish of the ceiling.
Use a caulk gun to inject a latex caulk into the gap. Use a putty knife to scrape the caulk flat and use a clean wet cloth to clean up any smears. After the caulk cures, you may paint it or stain it as you wish. Latex caulk expands or contracts with the house and it can be matched to the finish of your wood trim or the color of your ceiling.