My galaxy s5 came with a blocking app that would block all calls not on my contact list and I could set it to only block during certain times and when my phone did an update that app disappeared.
Go to settings, sounds and notifications, Do Not Disturb, you can set it from there. They changed the name and hid it but it still functions the same, at least for my needs. Hope this helps!