You found an oversight in the cleveref package. First, algorithm2e numbers the lines with the AlgoLine counter, and cleveref does not track that. So we need a
\crefalias{AlgoLine}{line}
to get that sorted.
Next, cleveref hacks into the \label command to write another label for its own use. In your example, the .aux contains
\newlabel{line}{{3}{1}{}{AlgoLine.1.3}{}}
\newlabel{line@cref}{{[line][1][]1}{1}}
The second line is written by cleveref. The offending part here is {[line][1][]1}, which is actually the content of \cref@currentlabel. Why is it wrong? While \label looks at \@currentlabel, cleveref uses its own \cref@currentlabel to determine what is been labeled. In order to keep that up to date, cleveref hacks into \refstepcounter, and updates \cref@currentlabel there. This works fine when algorithm2e is used without hyperref, but when hyperref is also loaded, the AlgoLine counter is updated with \stepcounter, and cleveref does not hack into that! This also means that cleveref will fail on all counters that are not (only) manipulated with \refstepcounter.
The solution is to also hack into \stepcounter, and update \cref@currentlabel there, too. The code for doing so is the same as for \refstepcounter. The complete code is then
\documentclass[paper=A4, fontsize=11pt]{scrbook}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[linesnumbered]{algorithm2e}
\usepackage{hyperref}
\usepackage{cleveref}
\crefalias{AlgoLine}{line}%
\makeatletter
\let\cref@old@stepcounter\stepcounter
\def\stepcounter#1{%
\cref@old@stepcounter{#1}%
\cref@constructprefix{#1}{\cref@result}%
\@ifundefined{cref@#1@alias}%
{\def\@tempa{#1}}%
{\def\@tempa{\csname cref@#1@alias\endcsname}}%
\protected@edef\cref@currentlabel{%
[\@tempa][\arabic{#1}][\cref@result]%
\csname p@#1\endcsname\csname the#1\endcsname}}
\makeatother
\begin{document}
\begin{algorithm}
Do something\;
Do more\;
Do something else\;\label{line}
\end{algorithm}
line~\ref{line} vs.\ \cref{line}
\end{document}
cleverefdoesn't seem to know lines). But shouldn't you be ending your lines by `\` so there actually is a linebreak? – Anke Mar 18 at 14:03algorithm2eandcleverefpackes decides whether cleveref know what a line is. I added a link to an online LaTeX processor, which produces the same output. So far, using\;always worked for me. – Dan Mar 18 at 14:10cleverefhas to be loaded afterhyperref, which has to come after everything else, so I don't see how you would be able to change the order there. I don't know what the difference between this online compiler and mine is, but I don't see why yours knows lines with the above MWE, while mine doesn't, or why yours refers to different lines, while mine refers to the same (line 1...) – Anke Mar 18 at 14:59cleverefandalgorithm2epackages, possibly introduced when thealgorithm2epackage was last updated, in Jan. 2013. I'd encourage you to contact the author of thecleverefpackage to make him aware of this issue. (Thecleverefpackage was last updated in Sept. 2012...) You may find his contact information on the title page of the manual of the cleveref package. – Mico Mar 18 at 16:06