The answer is quite classical when $f \colon X \to Y$ is an unramified double cover. In this case Riemann - Hurwitz formula gives
$g(X)-1 = 2g(Y)-2$.
Consider the following three natural maps:
$f^* \colon J(Y) \to J(X)$,
$Nm \colon \textrm{Pic}^0(X) \to \textrm{Pic}^0(Y), \quad Nm(\sum a_ip_i):= \sum a_if(p_i)$
$\tau \colon J(X) \to J(X)$,
where $f^*$ is induced by the pull-back of $0$-cycles, $Nm$ is the norm map and $\tau$ is the involution induced by the double cover $f$.
Then
$\textrm{Ker} \; f^*=\langle L \rangle$, where $L$ is a point of order $2$ in $J(Y)$;
the connected component of $Nm^{-1}(0)$ containing the identity coincides with the image of $I-\tau$. It is an Abelian subvariety of $\textrm{Pic}^0(X)$ of dimension $g(Y)-1$, that is denoted by $\textrm{Prym}(X, \tau)$.
Moreover, under the identification of $\textrm{Pic}^0(X)$ with $J(X)$, the principal polarization of $J(X)$ restricts to twice a principal polarization on $\textrm{Prym}(X, \tau)$.
The geometry of Prym varieties is very rich. In particular, Riemann-Hurwitz identity
$K_X =f^*K_Y$
induces subtle relations between the Theta divisor $\Theta$ of $X$ and the Theta divisor $\widetilde{\Theta}$ of $\textrm{Prym}(X, \tau)$.
You can look at [Arbarello-Cornalba-Griffiths-Harris, Geometry of algebraic curves, Appendix C] or at [Birkenhake-Lange, Complex Abelian Varieties, Chapter 12] for further details.
In the general case, it is possible to define the so-called generalized Prym varieties, at least where $f \colon X \to Y$ is a tame Galois branched cover. Look for instance at the paper of MERINDOL
"Varietés de Prym d'un revetement galoisien [Prym varieties of a Galois covering]"
Journal Reine Angew. Math. 461 (1995), 49-61.