The sky is spoken of as if it were a building in which God stores the rain, and when God does not want it to rain he closes the door to the building. Alternate translation: "When you do not allow rain to fall from the skies" (See: [[rc://en/ta/man/translate/figs-metaphor]])
Here "turn from" is a metaphor for stopping doing it. Alternate translation: "stop committing their sins" or "stop acting sinfully" (See: [[rc://en/ta/man/translate/figs-metaphor]])