Governor Philip D. Murphy signed a law on Thursday that bans student cellphones and other internet-enabled devices in New Jersey public schools, a move he completed during a ceremony at Ramsey High School 12 days before he is scheduled to leave office. The law, which Mr. Murphy called a "