I'm trying to get the subsubsection into the table of contents, but I can't get the numbering on the side of the subsubsection title.

\documentclass{toptesi}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\setcounter{secnumdepth}{4}
\setcounter{tocdepth}{3}

\begin{document}
\tableofcontents
\chapter{chapter 1}
\section{section 1}
\subsection{subsection 1}
\subsubsection{subsubsection 1}
\end{document}

• I can't compile your document, even with the .sty that you provided, since \documentclass expects toptesi.cls. Can you please provide the appropriate setup to replicate your current issue? – Werner Mar 2 '18 at 17:27
• @Werner I've edited the post with the .cls file – Alessandro Gaballo Mar 2 '18 at 19:00
• I see, you're using the standard toptesi bundle. In that regard, since it's on CTAN, there's actually no need to post the links. – Werner Mar 2 '18 at 19:21

The toptesi class uses within \AtBeginDocument \frontmatter, the latter restricting to secnumdepth to 2. You need an explicit

\mainmatter\setcounter{secnumdepth}{3} after that.

\documentclass{toptesi}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\setcounter{secnumdepth}{4}
\setcounter{tocdepth}{3}

\usepackage{blindtext}

\begin{document}
\tableofcontents

\mainmatter
\setcounter{secnumdepth}{4}

\chapter{chapter 1}
\section{section 1}
\subsection{subsection 1}
\subsubsection{subsubsection 1}

\blindtext
\end{document}