For a cracked drywall "joint"(between 2 sheets of drywall), then I say cut out old paper and retape and remud. For holes in the drywall, I prefer to fix and required and fill with mud. Spackle is ok for small holes like nail holes.
Since we are talking about gaps between wood casing and the drywall, then I suggest a long life paintable acrylic latex caulk in white or clear. It also works well for the cracks between door jambs and stops, etc. when painting the door jambs. Laying a fine bead is easier and cleanup is easier than a silicone.
Even though some silicone caulk is paintable, I save silicone for areas around water such as tubs, sinks, etc. cause it can be a mess to work with and recaulking can require strict cleanup of the old.