I am licensed to practice in Florida, but there are probably similar laws in NY that would be applicable to your case. In Florida, there are laws protecting against harrassing phone calls, as well as stalking. Repeated harassing and/or threatening text messages could potentially be considered criminal behavior under these statutes. If you wish criminal charges to be brought against them, you should contact law enforcement, and the local prosecutor's office to see if they believe that these communications rise to the level of criminal behavior.
If they are repetitiive or serve no legitimate purpose you can accuse themof Aggravated Harassment. Many criminal cases are coming about now due to repeated threatening or harmful text messages. Go to your local precinct and fill out a complaint report. You can also go into Family Court and file for an Order of Protection if you don't want to have them arrested.