Only file owners and administrators have the power to change the value of File Privacy on Records.
This feature is on by default. Just add the File Privacy on Records field to the Files page layout (labeled the Content Version page layout in the Setup menu). After the field is added to the page layout, users see the file privacy field on the file’s detail page and edit panel in Lightning Experience. It also appears in the content detail page and content edit dialog in Salesforce Classic. A file marked as private in Lightning Experience is also private in Salesforce Classic.
Chatter REST API supports private files on records.