Solubility depends on the principle, "like-dissolves-like." A polar solvent such as water will dissolve polar and ionic solutes whereas a nonpolar solvent will dissolve nonpolar solutes.
In all your questions, the 2 solvents you are given are water, which is polar, and hexane, which is nonpolar. In each question, identify the solute as either polar or nonpolar, and that should help you figure out its solubility.
A) NaCl is an ionic salt, therefore, very polar. Hence, it will be more soluble in water.
B) HF is polar and will be more soluble in water. In addition, HF can form hydrogen bonding interactions with water, which contributes to its solubility.
C) Octane is a hydrocarbon consisting of only carbon and hydrogen atoms making it nonpolar. Hence, it will only be soluble in hexane (nonpolar solvent).
D) (NH4)2SO4 is an ionic salt (very polar), which will be water soluble.