  We consider the problem of the distribution of the sojourn time in a compact
set $\mathbb{Z}_{p}$ in the case of a $p$-adic random walk. We rely on the
results of our previous studies of the distribution of the first return time
for a $p$-adic random walk and the results of Takacs on the study of the
sojourn time problem for a wide class of random processes. For a $p$-adic
random walk we find the mean sojourn time of the trajectory in $\mathbb{Z}_{p}$
and the asymptotics as $t\rightarrow\infty$ of arbitrary moments of the
distribution of the sojourn time in $\mathbb{Z}_{p}$. We also discuss some
possible applications of our results to the modeling of relaxation processes
related to the conformational dynamics of protein.
