At JFK, the Delta flight number indicates the scheduled departure terminal. That is, flight numbers beginning with "2" indicate departure from T2 and those beginning with "4" indicate departure from T4.
Of course, there can always be exceptions, last-minute gate changes, etc., so it's best to check Delta.com nearer to departure. But the flight number itself is generally a reliable guide.