How to minimize the app window (freeform mode/pop-up view)?
The phone in the question uses Android 5. I was now also using another phone with Android 6. In this version I stumbled over the answer by accident. This also works in my Android 5 phone.

You swipe diagonally from one upper corner. (If you don't hit a clean diagonal swipe, you will naturally risk getting a "settings"-screen or what the app in question does for horizontal swipe.



Click image for larger variant

Here it is called the gesture for "pop-up view".

(If I make the diagonal swipe for this app (SE), I get a red frame. It probably indicates that minimization of this app has been disabled.)