New York state passed a law on Friday banning guns from many public places, including Times Square, and requiring gun-license applicants to prove their shooting proficiency and submit their social media accounts for review by government officials.