Single space lines exceeding one line in list of figures in LaTeX In my dissertation, text needs to be double spaced but lines in table of contents and list of figures that exceed one line are needed to be single space. In the following code, I am able to do this in table of contents but it is not working for list of figures:
\documentclass[12pt]{article}
\usepackage{setspace}
\doublespacing 
\usepackage{tocloft}
\renewcommand\cftsecafterpnum{\vskip\baselineskip}
\renewcommand\cftsubsecafterpnum{\vskip\baselineskip}
\renewcommand\cftsubsubsecafterpnum{\vskip\baselineskip}
\titleformat{\section}[block]{\Large\bfseries\filcenter}{}{}{}
\renewcommand{\contentsname}{\hfill\bfseries\Large TABLE OF CONTENTS\hfill}  
\renewcommand{\cfttoctitlefont}{\hspace*{\fill}\Huge\bfseries}
\renewcommand{\cftaftertoctitle}{\hspace*{\fill}}
\renewcommand{\cftlottitlefont}{\hspace*{\fill}\Huge\bfseries}
\renewcommand{\cftafterlottitle}{\hspace*{\fill}}
\renewcommand{\cftloftitlefont}{\hspace*{\fill}\Huge\bfseries}
\renewcommand{\cftafterloftitle}{\hspace*{\fill}} 
\renewcommand{\cftfigpresnum}{Figure \ }
\renewcommand{\cfttabpresnum}{Table \ }
\newlength{\mylenf}
\settowidth{\mylenf}{\cftfigpresnum}
\setlength{\cftfignumwidth}{\dimexpr\mylenf+1.5em}
\setlength{\cfttabnumwidth}{\dimexpr\mylenf+1.5em}


\begin{document}

\begin{singlespace}
  \tableofcontents
\end{singlespace}
\newpage

\begin{singlespace}
    \listoftables
\end{singlespace}   
\addcontentsline{toc}{section}{List of Tables}
\newpage

\begin{singlespace}
    \listoffigures
\end{singlespace}   
\addcontentsline{toc}{section}{List of Figures}
\newpage

\end{document}

Based on this code, the entire list of tables and list of figures become single spaced. Could you please tell me how can I solve this issue?

The statements in the question are unclear. It works indeed for the ToC but not for the LoF and LoT, since the relevant \cftfigureafterpnum macros are not redefined similarly to their sec, subsec and subsubsec variants.
However, it does not really look nice altogether, especially with the fact that there is additionally spacing before each sec etc. entry that could be controlled with \cftbeforesecskip (and the related variants for subsec and subsubsec as well, i.e. \cftbeforesubsecskip and \cftbeforesubsubsecskip).
I've changed the explicit \begin{singlespacing}...\end{singlespacing} to be written to the relevant .toc etc. files as well added tocbibind package in order to include the list of... in the ToC.
Finally, I changed the weird \renewcommand{\contentsname} to something more convenient with \cfttoctitlefont etc.
\documentclass[12pt]{article}

\usepackage{blindtext}
\usepackage{pgffor}
\usepackage{setspace}
\doublespacing 
\usepackage{tocloft}
\usepackage{tocbibind}


\renewcommand\cftsecafterpnum{\vskip\baselineskip}
\renewcommand\cftsubsecafterpnum{\vskip\baselineskip}
\renewcommand\cftsubsubsecafterpnum{\vskip\baselineskip}

% My invention (C.H)
\renewcommand\cftfigafterpnum{\vskip\baselineskip}
\renewcommand\cfttabafterpnum{\vskip\baselineskip}


%\titleformat{\section}[block]{\Large\bfseries\filcenter}{}{}{}% No titlesec

%\renewcommand{\contentsname}{\hfill\bfseries\Large TABLE OF CONTENTS\hfill}% Bad idea

\renewcommand{\contentsname}{TABLE OF CONTENTS}
\renewcommand{\cfttoctitlefont}{\hfill\bfseries\Large}
\renewcommand{\cftaftertoctitle}{\hfill}

\renewcommand{\cfttoctitlefont}{\hspace*{\fill}\Huge\bfseries}
\renewcommand{\cftaftertoctitle}{\hspace*{\fill}}
\renewcommand{\cftlottitlefont}{\hspace*{\fill}\Huge\bfseries}
\renewcommand{\cftafterlottitle}{\hspace*{\fill}}
\renewcommand{\cftloftitlefont}{\hspace*{\fill}\Huge\bfseries}
\renewcommand{\cftafterloftitle}{\hspace*{\fill}} 
\renewcommand{\cftfigpresnum}{Figure \ }
\renewcommand{\cfttabpresnum}{Table \ }


% Only if needed
%\setlength{\cftbeforesubsecskip}{0pt}
%\setlength{\cftbeforesecskip}{0pt}


\newlength{\mylenf}
\settowidth{\mylenf}{\cftfigpresnum}
\setlength{\cftfignumwidth}{\dimexpr\mylenf+1.5em}
\setlength{\cfttabnumwidth}{\dimexpr\mylenf+1.5em}


\AtBeginDocument{
  \addtocontents{toc}{\protect\begin{singlespacing}}
  \addtocontents{lof}{\protect\begin{singlespacing}}
  \addtocontents{lot}{\protect\begin{singlespacing}}
}

\AtEndDocument{%
  \addtocontents{toc}{\protect\end{singlespacing}}
  \addtocontents{lof}{\protect\end{singlespacing}}
  \addtocontents{lot}{\protect\end{singlespacing}}
}


\begin{document}



\tableofcontents

\clearpage
\listoftables

\clearpage
\listoffigures
\clearpage

\foreach \x in {1,2,3,4,5} 
{
  \section{My foo section \x}
  \subsection{My foo subsection \x} 
  \begin{figure}
    \caption{ A caption \x}
  \end{figure}

  \blindtext[10]

  \begin{table}
    \caption{ A caption \x}
  \end{table}


  \begin{figure}
    \caption{ Another caption \x}
  \end{figure}

  \blindtext[3]


  \begin{table}
    \caption{ Another caption \x}
  \end{table}

}
  
\end{document}


I've omitted a screen shot for the list of tables, however -- it does not show something really different from the LoF.