You cannot have one length register hold two different values. Once you execute \questionshook, \labelwidth will be -\labelsep (whatever value the latter may have), and after you execute \partshook, \labelwidth will be 8mm. It can't be both at the same time.
What you can do, is save those values in a different register, say, \partlabelwidth and \questionlabelwidth, and then use these names in the document.
In the MWE below I defined four new length registers, \partlabelsep, \partlabelwidth, \questionlabelsep, and \questionlabelwidth. Then, inside a group, I used \partshook to make the part values active, and then copied them to the new registers using \global\setcounter, and then the same to \questionshook. Beware that some values are not initialised in \questionshook, so the order here matters!
When you have those values, you can use the mighty \the to print their value:
\documentclass{exam}
\usepackage{verbatim}
\renewcommand{\questionshook}{%
\setlength{\leftmargin}{0pt}%
\setlength{\labelwidth}{-\labelsep}%
}
\renewcommand{\partshook}{%
\setlength{\labelwidth}{8mm}%
\setlength{\leftmargin}{\labelwidth}%
\setlength{\labelsep}{0pt}%
\setlength{\itemsep}{0.5\baselineskip}%
\def\makelabel##1{##1}%
}
\newlength{\partlabelsep}
\newlength{\partlabelwidth}
\newlength{\questionlabelsep}
\newlength{\questionlabelwidth}
\begingroup
\partshook
\global\setlength{\partlabelsep}{\labelsep}
\global\setlength{\partlabelwidth}{\labelwidth}
\questionshook
\global\setlength{\questionlabelsep}{\labelsep}
\global\setlength{\questionlabelwidth}{\labelwidth}
\endgroup
\begin{document}
The length of question \verb|\labelwidth| is \the\questionlabelwidth\ and its \verb|\labelsep| is \the\questionlabelsep,
while the length of part \verb|\labelwidth| is \the\partlabelwidth\ and its \verb|\labelsep| is \the\partlabelsep.
\end{document}
\the:\the\labelwidth,\the\labelsep– Phelype Oleinik Sep 02 '19 at 21:06\questionshook,\labelwidthwill be-\labelsep(whatever value the latter may have), and after you execute\partshook,\labelwidthwill be8mm. It can't be both at the same time. You can, of course, save those values in a different register, say,\partlabelwidthand\questionlabelwidth, and then use these in the document. – Phelype Oleinik Sep 02 '19 at 21:10