By constitutional design, impeachment for “treason, bribery, or other high crimes and misdemeanors” is a political accusation and initiates a political remedy, not a legal one. It is pretty much up to Congress to define and apply “high crimes and misdemeanors,” and no court would second-guess it.
The next Congress could find that the president had violated his oath to “faithfully execute” the laws by refusing to enforce important provisions of the Affordable Care Act, No Child Left Behind and, now, the Immigration and Nationality Act.
The president surely has some power to withhold prosecution, but granting legal status and work permits to millions of people most likely exceeds his discretion. No judge can decide the precise scope of his discretion because no one, including Congress, has legal standing to challenge his order in court.