You can use the explicit
option for titlesec to place the title inside a \parbox
of the desired length; notice that now you need to use #1
(typically in the last mandatory argument for \titleformat
) to get the title for the sectional unit. I used \textwidth-3em
as the width for the box, but you can change this value according to your needs. In the example below I provided some definitions for the colors used since they were not given in the question:
\documentclass{scrbook}
\usepackage{xcolor}
\usepackage[explicit]{titlesec}
\usepackage{lmodern}% just for the example
\usepackage{lipsum}% just for the example
\usepackage{hyperref}
\colorlet{ctcolorchapterline}{cyan}
\colorlet{ctcolorchapternum}{cyan}
\titleformat{\chapter}[display]%
{\usekomafont{chapter}}%
{\vspace{-8em}\raggedleft{%
{\color{ctcolorchapterline}%
\rule[-5pt]{2pt}{5cm}}\quad%
{\color{ctcolorchapternum}
\fontsize{60}{60}\selectfont\thechapter}%
}%
}%
{-2.1em}%
{\parbox[b]{\dimexpr\textwidth-3em\relax}{\raggedright#1}}%
[\phantomsection]
\begin{document}
\chapter{A test chapter with a long title that will span two lines}
\lipsum[4]
\end{document}

As egreg has pointed out in his comment, one can avoid using the explicit
option using an auxiliary macro:
\documentclass{scrbook}
\usepackage{xcolor}
\usepackage{titlesec}
\usepackage{lmodern}% just for the example
\usepackage{lipsum}% just for the example
\usepackage{hyperref}
\colorlet{ctcolorchapterline}{cyan}
\colorlet{ctcolorchapternum}{cyan}
\newcommand\mychapformat[1]{%
\parbox[b]{\dimexpr\textwidth-3em\relax}{\raggedright#1}}
\titleformat{\chapter}[display]%
{\usekomafont{chapter}}%
{\vspace{-8em}\raggedleft{%
{\color{ctcolorchapterline}%
\rule[-5pt]{2pt}{5cm}}\quad%
{\color{ctcolorchapternum}
\fontsize{60}{60}\selectfont\thechapter}%
}%
}%
{-2.1em}%
{\mychapformat}%
[\phantomsection]
\begin{document}
\chapter{A test chapter with a long title that will span two lines}
\lipsum[4]
\end{document}
I added \sectfont
to your definitions so you can keep the boldfaced sansseerf font used by default in KOMA sectional units:
\documentclass{scrbook}
\usepackage{xcolor}
\usepackage{titlesec}
\usepackage{lmodern}% just for the example
\usepackage{lipsum}% just for the example
\usepackage{hyperref}
\colorlet{ctcolorchapterline}{cyan}
\colorlet{ctcolorchapternum}{cyan}
\newcommand\mychapformat[1]{%
\parbox[b]{\dimexpr\textwidth-3em\relax}{\raggedright#1}}
\titleformat{\chapter}[display]%
{\usekomafont{chapter}\sectfont}%
{\vspace{-8em}\raggedleft{%
{\color{ctcolorchapterline}%
\rule[-5pt]{2pt}{5cm}}\quad%
{\color{ctcolorchapternum}
\fontsize{60}{60}\selectfont\thechapter}%
}%
}%
{-2.1em}%
{\mychapformat}%
[\phantomsection]
\begin{document}
\chapter{A test chapter with a long title that will span two lines}
\lipsum[4]
\end{document}

Notice that titlesec
and KOMA-Script might not be fully compatible (you'll get a warning from the KOMA classes when loading titlesec
); see Incompatibilities between KOMA-Script and titlesec
\documentclass{...}
and ending with\end{document}
.newlinetospace
option.