Is it possible to construct a non-bijective and non-constant holomorphic map from Riemann surface $S$ to itself where $S$ is homeomorphic to a compact surface of genus $g \geq 2$? What about the case when $S$ is homeomorphic to a compact surface of genus $g \geq 1$ with $p \geq 1$ points removed?
Edit: For the first case, one can prove that every non-constant holomorphic map on such a Riemann surface $S$ should be surjective and after it is possible to apply Riemann-Hurwitz formula to show that such a map can’t have critical points and has a degree one, so it should be a biholomorphism. This still works for the second case (with punctures) if we assume that our maps are surjective and have finite degrees, however I am not sure whether they are always surjective and how to prove non-existence of maps of infinite degree.
Here is an updated version of my original answer.
Let $f: X\to X$ be a nonconstant holomorphic map from a Riemann surface to itself. I will explain under which conditions you can conclude that $f$ is biholomorphic.
I will need some terminology.
Definition. A Riemann surface $X$ is said to have finite type if it is obtained from a compact Riemann surface $\hat{X}$ (the "completion" of $X$) by removing a finite subset (the "punctures" of $X$). A Riemann surface is said to have finite topological type if it is homeomorphic to a Riemann surface of finite type. A Riemann surface $X$ is said to have hyperbolic type if its universal covering space is biholomorphic to the unit disk. (By the Uniformization Theorem, every Riemann surface either has hyperbolic type or is $CP^1$ or its universal covering space is biholomorphic to the complex line.)
Note that if $\hat{X}$ has genus $\ge 2$ then $X$ has hyperbolic type; similarly, if $\hat{X}$ has genus 1 and $X$ has at least one puncture, then it has hyperbolic type; same when $\hat{X}$ has genus $0$ and $X$ has at least three punctures.
Riemann-Hurwitz formula implies that if $X$ has finite typerbolic type, then every nonconstant holomorphic self-map $f: X\to X$ is biholomorphic. (From the comments, you already know how to prove this, so I will not explain the argument.)
Theorem 1. Suppose that $X$ has finite hyperbolic type. Then every nonconstant holomorphic self-map $f: X\to X$ is biholomorphic.
In view of the remark above, the proof of Theorem 1 reduces to the following proposition on removable singularities:
Proposition 1. Suppose that $X, Y$ are a Riemann surfaces of finite and hyperbolic type. Then every holomorphic map $f: X\to Y$ extends to a holomorphic map $\hat{f}: \hat{X}\to \hat{Y}$.
Proof. The problem is "local": For every puncture $p\in \hat{X}-X$ and a small disk neighborhood $D$ of $p$ in $\hat{X}$, we have to show that the restriction of $f$ to the punctured disk $D^*=D-\{p\}$ extends to $p$, resulting in a holomorphic map $D\to \hat{Y}$. Since $\pi_1(D^*)$ is infinite cyclic, the image group $$ H=f_*(\pi_1(D^*))< G=\pi_1(X) $$ is also cyclic (infinite or trivial). Let $q:\tilde{X}\to X$ denote the covering space corresponding to the subgroup $H<G$; in particular, $\pi_1(\tilde{X})$ is cyclic and, hence, by the Uniformization Theorem, $\tilde{X}$ is biholomorphic either to the unit disk or to the annulus or to the punctured unit disk. In any case, by the covering theory, the map $f$ lifts to a holomorphic map $$ \tilde{f}: D^*\to \tilde{X}, $$ i.e. $q\circ \tilde f=f$.
Consider first the easier case when $H$ is trivial, equivalently, $\tilde{X}$ is biholomorphic to the unit disk $\Delta$. Then $\tilde{f}$ has bounded image in the complex plane and, hence, $\tilde{f}$ extends to a holomorphic map $h: D\to \Delta$. Composing with $q$, we obtain the desired extension $\hat{f}: D\to Y\subset \hat{Y}$ of $f$.
There are no holomorphic maps from the punctured disk to the annulus inducing isomorphism of fundamental groups. (You can prove this also using Riemann's removable singularities theorem; I will leave it to you to work out the details.)
The most interesting case is when $\tilde{X}$ is (biholomorphic to) the punctured disk $\Delta^*=\Delta=\{z: |z|<1\} \setminus \{0\}$. One needs a bit of theory of Fucshian groups (Shimizu's lemma) to prove that there is a smaller disk $\Delta_r=\{z: |z|<r\}$, such that the image $q(\Delta_r)$ is a small disk neighborhood $D'$ of a puncture $p'\in \hat{Y}\setminus Y$ and, moreover, the (restricted) map $q: \Delta_r^*\to D'\setminus \{p'\}$ is a finite degree covering map.
Again, by Riemann's theorem, $\tilde{f}$ extends to a holomorphic map $h: D\to \Delta$, necessarily sending $p$ to $0$. By shrinking the disk $D$, we get $h(D)\subset \Delta_r$. Hence, by composing $\tilde f$ with $q|\Delta^*_r$, we obtain the desired holomorphic extension of $f$ to the point $p$, namely, $\hat{f}(p)=p'$. qed
Suppose now that $X$ has finite topological type but not finite type. One can show (using the uniformization theorem) that there exists a compact Riemann surface with nonempty (real-analytic) boundary, $\hat{X}$, such that $X$ is biholomorphic to $\hat{X}\setminus (P \cup \partial \hat{X})$, where $P$ is a (possibly empty) finite subset of the interior of $\hat{X}$.
Ahlfors proved in
Ahlfors, Lars V., Open Riemann surfaces and extremal problems on compact subregions, Comment. Math. Helv. 24, 100-134 (1950). ZBL0041.41102.
that there exists a nonconstant surjective holomorphic map $f$ from $\hat{X}$ to the closed unit disk (see the end of section 4.2 in the paper). I am sure there is a better reference, I just do not have one. Restricting $h$ to $X\subset \hat{X}$, we obtain a nonconstant holomorphic map $h: X\to D$, the open unit disk. Composing with a conformal embedding of $D$ to the surface $X$, we obtain the desired holomorphic self-map $X\to X$. (It is clearly non-injective with one exception, namely, when $X$ is itself the unit disk. But then we can take $f(z)=z^2$.)
Lastly, consider the case when $X$ has finite non-hyperbolic type. Then $X$ always admits a nonconstant non-injective holomorphic self-map. The argument is a boring case-by-case analysis. For instance, if $X$ is ${\mathbb C}^*={\mathbb C} - \{0\}$, then you can use the exponential map. If $X$ is the quotient of the complex plane by a lattice $\Gamma$, then the map $z\mapsto 2z$ normalizes $\Gamma$ and, descends to a degree 2 holomorphic self-map of $X$.