You can always get an $f$ of degree $\max(g+1,n)$, where $g$ is the genus and $n$ the number of points in $S$. I don't think it is a good estimate (the problem is that I construct $f$ so that every point of $S$ is a (simple) pole; there should be $f$'s with lower degrees if the values at points of $S$ are different)
Here is how to see it. Let $P_1,\dots,P_n$ be the points in $S$ and let $z_i$ be a local coordinate around $P_i$ (s.t. $z_i(P_i)=0$) on some disc $D_i\subset \Sigma$. Suppose the discs don't overlap. The function $1/z_i$ on $D_i\cap (\Sigma -P_i)$ gives a class $\alpha_i\in H^1(\Sigma,\mathcal{O})\cong\Omega^1(\Sigma)^*$ (use $D_i$ and $\Sigma-P_i$ as an open cover of $\Sigma$; $1/z_i$ is a function on $D_i\cap(\Sigma-P-i)$). We know that $\alpha_i\neq0$ (if $\alpha_i$ were a coboundary then $1/z_i=h-k$, where $h$ is holomorphic on $\Sigma-P_i$ and $k$ on $D_i$, but that means that $h$ is meromorphic on $\Sigma$ with a unique pole at $P_i$, which is impossible if g>0).
We can suppose $n>g$ (if not then add some more points to $S$). As $\dim H^1(\Sigma,\mathcal{O})=g$ and all $\alpha_i$'s are non-$0$, there are $c_1,\dots,c_n\in\mathbb{C}$, all non-$0$, such that $\sum c_i\alpha_i= 0\in H^1(\Sigma,\mathcal{O})$. If you write $\sum c_i\alpha_i$ as a coboundary for the open cover $\Sigma-S,D_1,D_2,\dots,D_n$ of $\Sigma$, the holomorphic function on $\Sigma-S$ is a meromorphic function on $\Sigma$ with a simple pole at every point of $S$, hence non-ramified at $S$, and its degree is the number of poles (i.e. $n$).
edit I changed my answer completely as it contained a mortal gap