Let's say you want to create an assignment, but want to hide it from a subset of your students (permanently or temporarily). This article will walk through how to do that.
Create some sections
First, you'll need to group students from which you want to hide the assignment into sections.
Hide the assignment
From your assignment settings, navigate to the "Hide from" setting in the "General" tab. From here, you can select sections from which to hide the assignment.
Note that the assignment will remain hidden to these sections, even if an assignment is made visible to your course. Students in sections from which the assignment is hidden won't see any information about the assignment, nor will they be able to submit (even if you've enabled student upload). Just remove the section from this field to make it possible for students to view the assignment (so long as the assignment is visible).