Let $G={\rm SL}(n)\times {\rm SL}(n')$ and let $H\subset G$ denote the stabilizer of $J_k$ in $G$. We write ${\frak X}(G)$ for the character group of $G$. Then ${\frak X}(G)=0$. We have a canonical isomorphism ${\rm Pic}\,X_k\cong {\frak X}(H)$;
see [this answer](https://mathoverflow.net/a/379182/4149).
See also  Proposition 6.10 in Sansuc's paper [Groupe de Brauer et arithmétique des groupes algébriques linéaires sur un corps de nombres](http://www.digizeitschriften.de/dms/img/?PID=GDZPPN002198746&physid=phys48#navi). 

For $g\in G={\rm SL}(n)$, $g'\in{\rm SL}(n')$, 
we write $g=\begin{pmatrix} A&B\\C&D \end{pmatrix}$, 
$g'=\begin{pmatrix} A'&B'\\C'&D' \end{pmatrix}$,
where $A,A'$ are $k\times k$ square matrices, 
$D$ is an $(n-k)\times(n-k) $-square matrix, 
and $D'$ is an $(n'-k)\times(n'-k)$-square matrix. 
To compute $H$, we solve the equation
$$ g\, J_k\, g^{\prime\, T}=\lambda J_k, \quad\lambda\in K^\times,$$
where $K$ is the base field. 
We obtain 
$$C=0,\quad  C'=0,\quad  AA^{\prime\, T}=\lambda I_k.$$


We assume that $k\ge 1$. If $n>k$ and $n'>k$, then the character group ${\frak X}(H)$
is generated by the the characters:
$$d_A=\det A,\quad d'_A=\det A',\quad \lambda,\quad d_D=\det D,\quad d'_D=\det D',$$
satisfying the relations
$$ d_A+d_D=0,\quad d'_A+d'_D=0,\quad  d_A+d'_A=k\lambda. $$
We see that ${\frak X}(H)$ is a free abelian group with two generators $d_A$ and $\lambda$, and hence ${\rm Pic}\,X_k\simeq {\Bbb Z}\oplus {\Bbb Z}$.

If $n=k$ but $n'>k$, then we have $d_D=0$, and hence $d_A=0$. We see that ${\frak X}(H)$ is a free abelian group with one generator $\lambda$, 
and hence ${\rm Pic}\,X_k\cong {\Bbb Z}$.

Similarly, if $n'=k$ but $n>k$, then we have $d'_D=0$, and again 
${\rm Pic}\,X_k\cong {\Bbb Z}$.

Finally, if  $n=k$ and  $n'=k$, then we have $d_D=0$ and $d'_D=0$, whence 
$d_A=0$, $d'_A=0$, and $k\lambda=0$. 
We see that ${\frak X}(H)\cong {\Bbb Z}/k {\Bbb Z}$ with generator $\lambda$,
and hence  ${\rm Pic}\,X_k\cong {\Bbb Z}/k {\Bbb Z}$ in this case.