Donald Trump will not face sentencing in his New York criminal case until after the November presidential election, a judge has ruled.