The condition you want is $X$ a locally noetherian scheme. Then by Hartshorne's "Residues & Dualities," Proposition 7.17, $\cal{F}$ is an injective ${\cal O}_X$-module if and only if for each $x \in X$, the stalks ${\cal F}_x$ are injective ${\cal O}_x$-modules. If the sections are injective ${\cal O}_X(U)$-modules, that should give injectivity on the stalks (abelian groups form a locally noetherian Grothendieck category, so use e.g., Henning Krause's "The Spectrum of a Module Category" Proposition A.11). For the reverse question, I think you need $X$ to be noetherian.