It is not yet possible but there are workarounds.
The most common way is to create a heading for that purpose e.g Archive
.
Then, whenever you would like to hide a completed task, simply drag & drop it under the heading.
You can even toggle the heading to hide everything in it.
In 2025, the views will serve that purpose, allowing to visualize your tasks the way you want.