Let $k$ be a global field, and $S$ a non-empty finite set of places of $k$ containing the archimedean places. It is certain that you meant to assume $G$ and $H$ are smooth and affine (hence the surjection between them is flat); I will assume both of these in what follows.

The answer is typically negative. For example, the Frobenius endomorphism of any ${\rm{SL}}_n$ (or any Chevalley group, for that matter) over $\mathbf{F}_p$ provides a counterexample. Indeed, there is an evident $S$-integral model for the situation (even one arising over $\mathbf{F}_p$ or $\mathbf{Z}$), and by basic facts about the well-posedness of $S$-arithmeticity it is equivalent to check if the coset space for the map between $S$-integral points is finite. To contradict this it is enough to do so with an $\mathscr{O}_{k,S}$-subgroup $U$ provided that $U(\mathscr{O}_{k,S})$ is the full preimage of itself under the induced map on $\mathscr{O}_{k,S}$-points. Any root group $U \simeq \mathbf{G}_a$ does the job, which is to say the infinitude is forced by that of the quotient of $\mathscr{O}_{k,S}$ modulo its subgroup of $p$th powers.

But the answer is affirmative whenever the $k$-group scheme $K := \ker f$ satisfies two properties: (i) the finite etale component group of $K/K^0$ has order not divisible by ${\rm{char}}(k)$ and (ii) $K^0$ is an extension of a smooth group by one of multiplicative type. (Note that (i) and (ii) always hold when ${\rm{char}}(k)=0$.) This comes down to the finiteness of the degree-1 fppf-cohomology set for any affine flat $\mathscr{O}_{k,S}$-group $\mathscr{K}$ whose generic fiber $\mathscr{K}_k$ satisfies (i) and (ii). That finiteness rests on reduction theory for semisimple groups over global fields (in the guise of its consequences for Galois cohomology of such groups) and on the structure theory of pseudo-reductive groups (since in (ii) we impose no reductivity hypotheses on the smooth group).

To carry out the reduction to that H$^1$-finiteness one has to prove that any quotient map between affine $k$-group schemes of finite type extends to a *flat surjection* (not just homomorphism!) between affine flat $\mathscr{O}_{k,S}$-groups of finite type. The point is that with such a flat surjective homomorphism over $\mathscr{O}_{k,S}$ in hand, the coset space for the induced map on $\mathscr{O}_{k,S}$-points (the finiteness of which is *equivalent* to the question posed about $S$-arithmeticity of an image) is a subset of such an H$^1$. We'll come back to the construction of such an $\mathscr{O}_{k,S}$-map at the end.

As for the H$^1$-finiteness theorem over $\mathscr{O}_{k,S}$ that we have mentioned, in the number field case it is Prop. 5.1 in the paper "Actions algebriques de groupes arithmetiques" by Gille and Moret-Bailly, a preprint version of which is available at http://math.univ-lyon1.fr/homes-www/gille//publis/action.pdf.

In the function field case, to prove the same H$^1$-finiteness result (under the additional restrictions on the $k$-group that we have mentioned), first one shows that it is permissible to enlarge $S$ due to the argument given near the end of the proof of that Prop. 5.1 which deduces it from the "finiteness of $S$-class numbers" of arbitrary affine group schemes of finite type. In the function field case, this "class number" finiteness for such group schemes is Theorem 1.3.1 in the paper "Finiteness theorems for algebraic groups over function fields" in Compositio 148. By enlarging $S$, the general finiteness of ${\rm{H}}^1(\mathscr{O}_{k,S}, \mathscr{K})$ (assuming $\mathscr{K}_k$ satisfies the conditions mentioned above) reduces to three cases: (i) $\mathscr{K}$ is finite etale with order not divisible by ${\rm{char}}(k)$, (ii) $\mathscr{K}$ is of multiplicative type, (iii) $\mathscr{K}_k$ is smooth and connected.

By using inclusion into Weil restriction from a big enough connected finite etale cover of ${\rm{Spec}}(\mathscr{O}_{k,S})$, and using that short exact sequences of $k$-tori split up to isogeny, for (i) and (ii) we respectively reduce to the constant case and the split case. The constant case of (i) is a consequence of the finiteness of the number of finite Galois extensions of $k$ with bounded degree not divisible by ${\rm{char}}(k)$ and with ramification contained within a fixed finite set of places. The split case of (ii) is a consequence of the $S$-unit theorem for global function fields. The hard case is (iii), and by the finiteness of degree-1 Tate-Shafarevich sets of affine $k$-group schemes of finite type (which is Theorem 1.3.3(i) in the Compositio 148 paper mentioned above) one can push through the proof of Gille and Morey-Bailly's Prop. 5.1 (see Theorem 7.2.1 in that Compositio paper, which has a typo of $\mu_p$ that should be $\alpha_p$ in the line just below its statement).

Now we come to the loose end which is crucial for reducing the original problem to that of finiteness of an fppf H$^1$:

**Theorem**. *Let $f:G \rightarrow H$ be a surjective flat homomorphism between affine $k$-group schemes of finite type. There exists a surjective flat homomorphism $F: \mathscr{G} \rightarrow \mathscr{H}$ between affine flat $\mathscr{O}_{k,S}$-group schemes of finite type such that $F_k = f$.*

Proof: Let $\mathscr{G}$ be a flat affine $\mathscr{O}_{k,S}$-group scheme with generic fiber $G$ (e.g., make this via schematic closure of $G$ in ${\rm{GL}}_{n, \mathscr{O}_{k,S}}$ relative to a choice of closed $k$-subgroup inclusion of $G$ into some ${\rm{GL}}_n$), and let $\mathscr{K}$ be the schematic closure in $\mathscr{G}$ of $\ker f$. By $\mathscr{O}_{k,S}$-flatness, $\mathscr{K}$ is normal in $\mathscr{G}$.

By work of Artin, the group-sheaf quotient $\mathscr{G}/\mathscr{K}$ for the fppf topology is an algebraic space that is separated, flat, and of finite type over $\mathscr{O}_{k,S}$. It suffices to show that this quotient is represented by an affine scheme. A reference for that affineness (as well as for good counterexamples if the Dedekind base is replaced with the affine plane over a field) is given in the answer to Is the category of affine fppf groups closed under normal quotients?

QED