First of all, whitespace in HTML coding is any string of text composed of spaces, tab and line breaks, which can be achieved by using CRLF sequence. CRLF means carriage returns or line feeds. So whitespace is use for indentation when coding on HTML. It's usually advice to give two indentation space when coding. These characters allows you to arrange you HTML codes in a way that makes it easy to be read by yourself or another developer.
So back to your question when to use whitespace when coding on HTML. You can use it when you are nesting the next line of code, just below the first code e.g
<p> School boy</p>