The comments on the previous answer express a desire for additional details, so I'll add some here for any future students looking at this question. Robin nicely explains how the only interesting multiplicative structure inside $H^*(M_g)$ comes from the cup product $H^1(M_g) \times H^1(M_g) \to H^2(M_g)$ so we focus on detailing this structure.
Fix the following notation: let $X := \bigvee_{i = 1}^g T_i$ with each $T_i$ a torus, let $A$ denote the subspace of $M_g$ equal to a $g$-punctured sphere, let $i : A \to M_g$ denote inclusion, and let $q: M_g \to M_g/A = X$ denote the quotient map. As Robin mentions, the strategy is use the fact (Hatcher proposition 3.10) that the square
$$
\require{AMScd}
\begin{CD}
H^1(X) \times H^1(X) @>{\cup}>> H^2(X) \\
@V{q^* \times q^*} VV @V{q^*}VV \\
H^1(M_g) \times H_1(M_g) @>{\cup}>> H^2(M_g)
\end{CD}
$$
commutes to get at the cup product structure on $M_g$ from (i) the (known) cup product structure on $X$ and (ii) the action of $q$ on cohomology. As (i) is addressed in the question and in Robin's answer, we focus on the details of (ii).
We consider a piece
$$
\cdots \rightarrow H_1(A) \xrightarrow{i_*} H_1(M_g) \xrightarrow{q_*} H_1(X) \xrightarrow{\delta} H_0(A) \xrightarrow{i_*} H_0(M_g) \to \cdots
$$
of the long exact sequence of homology induced by the pair $(M_g, A)$. Regard $H_1$ as the abelianisation of $\pi_1$ to see that the map $i_* : H_1(A) \to H_1(M_g)$ is zero (because loops in the subspace $A$ lie in the commutator subgroup of $\pi_1(M_g)$). Note also that $i_* : H_0(A) \to H_0(M_g)$ injects (by the definition of the zero-th homology) so that $\delta = 0$. Thus, $q_*$ is encased by zero maps and so induces an isomorphism on first homology. By the universal coefficient theorem for cohomology (noticing that the Ext terms vanish here), it follows that $q^*$ induces an isomorphism on first cohomology.
Understanding $q^*$ on second cohomology requires a bit more topology and in this case we'll think about $H_2$ in terms of simplicial homology. Let $q_i : X \to T_i$ denote the quotient map which collapses the wedge sum $X$ to the $i$-th torus in the sum. Then we have a commutative diagram
$$
\require{AMScd}
\begin{CD}
H_2(M_g) @>{q_*}>> H^2(X) @>{(q_i)_*}>> H^2(T_i) \\
@V{\cong} VV @V{\cong}VV @V{\cong}VV \\
\mathbb{Z} @>>> \mathbb{Z}^g @>>> \mathbb{Z}.
\end{CD}
$$
Letting $\sigma : \Delta^2 \to M_g$ represent the generating class in $H_2(M_g) \cong \mathbb{Z}$, that $\sigma$ is not a boundary in $H_2(M_g)$ implies that $q_i \circ q \circ \sigma$ is itself not a boundary in $H_2(T_i) \cong \mathbb{Z}$. In particular, $q_i \circ q \circ \sigma$ generates $H_2(T_i)$ so we see that $(q_i)_* \circ q_*$ maps 1 to 1 along the bottom row of the diagram. Now, the isomorphism $H_2(X) \cong \mathbb{Z}^g$ comes from the isomorphism $H_2(X) \cong \bigoplus_{i = 1}^g H_2(T_i)$ which is induced by the inclusions $T_i \hookrightarrow X$ (Hatcher corollary 2.25). So if $\sigma_i : \Delta^2 \to T_i$ represents a generator of $H_2(T_i)$ then the map $(q_i)_*$ sends $(0, \ldots, 0, \sigma_i, 0, \ldots, 0) \in H_2(X)$ to $\sigma_i$. Along the bottom row of the diagram, if we regard $\mathbb{Z}^g$ as generated by the standard basis vectors $\{e_1, \ldots, e_g\}$, then $(q_i)_*$ acts as $\varepsilon_i$ for $\varepsilon_i(e_j) := \delta_{ij}$. We conclude that for each $i$ we have $\varepsilon_i(q_*(1)) = 1$ from which it follows that $q_*(1) = (1, \ldots, 1) \in \mathbb{Z}^g \cong H_2(X)$. Again apply the universal coefficient theorem for cohomology (noting that the Ext terms still vanish) to see that $q^* : H^2(X) \to H^2(M_g)$ maps each of the $g$ generators of $H^2(X)$ to the same generator of $H^2(M_g)$. In terms of the isomorphisms $H^2(X) \cong \mathbb{Z}^g$ and $H^2(M_g) \cong \mathbb{Z}$, we have concluded that $q^*(e_i) = 1$ for all $i$.
With a precise understanding of the action of $q$ on cohomology, we may return to the original commuting square. We adopt the notation of the OP here: let $H^1(X)$ have generators $\{\alpha_i, \beta_i\}_{i = 1}^g$ and $H^2(X)$ have generators $\{\gamma_i\}_{i = 1}^g$ with $\alpha_i \beta_i = \gamma_i$ and all other products of generators zero (note that we use here the known cup product structure on the torus and that we adopt the convention that multiplication denotes a cup product). Then that $q^*$ induces an isomorphism on first cohomology implies that $H_1(M_g)$ has generators $\alpha_i' := q^*(\alpha_i)$ and $\beta_i' := q^*(\beta_i)$. And the action of $q^*$ on $H^2$ means that $H^2(M_g)$ has generator $\gamma' := q^*(\gamma_1) = \cdots = q^*(\gamma_g)$. By our very first commuting square, we conclude that
Theorem: The cohomology ring $\tilde{H}^*(M_g)$ is generated by $\{\alpha_i', \beta_i'\}_{i=1}^g \cup \{\gamma'\}$ with $\alpha_i'$ and $\beta_i'$ of weight one, $\gamma'$ of weight two, and nonzero cup product relations $\alpha_i' \beta_i' = \gamma'$ for all $i$ (all other cup products of generators are zero).