A man suspected of planning a terrorist attack on a New York City synagogue is set to appear in court.