If only those who died after Jesus death are among the ones that go to heaven, how do JWs view the ascension of Elijah? Jehovah's Witnesses believe that only 144000 (the group mentioned in Revelation 14:1-3) have a heavenly hope, while the rest of humankind have the hope of living forever on earth. This is for example explained in the selected answer to this question.

Additionally an answer to this other question says (emphasis added):


  However, all of these faithful ones from before Jesus' day have the
  earthly hope, just as most Jehovah's Witnesses have today. The
  heavenly hope has been reserved for 144,000 which have been chosen
  by Christ ever since his death. Those with the heavenly hope will
  assist Christ in ruling the righteous ones on Earth.


and


  This is the only distinction between those who died before Jesus'
  death and those who died after: the ones who died after are able to
  be members of the 144,000.


However 2 Kings 2:11 says that Elijah was taken to heaven:


  And it came to pass, as they still went on, and talked, that, behold,
  there appeared a chariot of fire, and horses of fire, and parted them
  both asunder; and Elijah went up by a whirlwind into heaven.


How do Jehovah's Witnesses view the case of Elijah if only those who died after Jesus' death are among the ones that go to heaven?
Jehovah’s Witnesses teach that Elijah indeed experienced a miraculous event when he was caught up into the heavens.
As all bible students know there are different meanings of heaven in the scriptures.
Your question indicates that you are of the belief that the heavens that Elijah ascended to was the dwelling place of God and angels. Jehovah’s witnesses do not share this view.
Rather we believe that it was into the atmospheric heavens where clouds are found that the miracle took Elijah.
After being caught away to the clouds he was transported to a different location on earth.
Insight on the Scriptures published by Jehovah’s Witnesses speaks about the different meanings of heaven in the Bible and on the ascension of Elijah it says:

Ascension to Heaven. At 2 Kings 2:11, 12 the prophet Elijah is described as “ascending in the windstorm to the heavens.” The heavens here referred to are the atmospheric heavens in which windstorms occur, not the spiritual heavens of God’s presence. Elijah did not die at the time of such ascension, but he continued to live for a number of years after his heavenly transportation away from his successor Elisha. Nor did Elijah upon death ascend to the spiritual heavens, since Jesus, while on earth, clearly stated that “no man has ascended into heaven.” (Joh 3:13; see ELIJAH No. 1 (Elisha Succeeds Him).) At Pentecost, Peter likewise said of David that he “did not ascend to the heavens.” (Ac 2:34) In reality, there is nothing in the Scriptures to show that a heavenly hope was held out to God’s servants prior to the coming of Christ Jesus. Such hope first appears in Jesus’ expressions to his disciples (Mt 19:21, 23-28; Lu 12:32; Joh 14:2, 3) and was fully comprehended by them only after Pentecost of 33 C.E.—Ac 1:6-8; 2:1-4, 29-36; Ro 8:16, 17.
The Scriptures show that Christ Jesus was the first one to ascend from earth to the heavens of God’s presence. (1Co 15:20; Heb 9:24) By such ascension and his presentation of his ransom sacrifice there, he ‘opened the way’ for those who would follow—the spirit-begotten members of his congregation. (Joh 14:2, 3; Heb 6:19, 20; 10:19, 20) In their resurrection these must bear “the image of the heavenly one,” Christ Jesus, in order to ascend to the heavens of the spirit plane, for “flesh and blood” cannot inherit that heavenly Kingdom.—1Co 15:42-50.