First open the editing gallery page from WordPress Dashboard > Galleries and click the gallery you want to add password protected.
On the gallery editing page. Look at the right sidebar option name “Visibility” and click “Edit”.
Then select “Password protected” and enter password you want to setup for this gallery. Once you finish click “ok” and update the gallery.