When was it first used and in what context?
The OED says the phrase "cool your jets", meaning to calm down or become less agitated, is originally US and the first quoted in a newspaper:
1973 Daily Tribune (Wisconsin Rapids) 29 Jan. 1/1 If you want to cool your jets, just step outside, where it will be about 10 degrees under cloudy skies.
That use is to literally cool yourself down. The first with the usual meaning is a bit later the same year:
1973 Independent Rec. (Helena, Montana) 21 Oct. 4/3 Nixon may be able to stifle Congress but he better cool his jets if he thinks he can mess with the rest of the world.
Like the OED (which Hugo cites in his answer), J. E. Lighter, Random House Dictionary of American Slang, volume 1 (1994) gives a first occurrence date of 1973 for "cool [one's] jets":
cool (one's) jets to take it easy; become less less agitated or excited.
[Examples:] 1973 Eble Campus Slang (Nov.) 1: Cool your jets—settle down and relax: Cool your jets or the cops will still think you're the guilty one. 1978 UTSQ Get off my case, cool your jets, take a hike. 1980–89 Cheshire Home Boy 310: Martinez ... bops him one ... Cruise cools his jets. 1989 Dream Street (NBC-TV): Cool your jets, man. He's my brother.
But a Google Books search finds an instance of "cool your jets" from 1970. From William Walter Scott, Hurt, Baby, Hurt (Ann Arbor, Michigan: New Ghetto Press, 1970): [combined snippets]:
If you're getting bored like hell, the feeling's mutual, but just cool your jets and wait for a while. I've sorta got to talk about the conflict between me and my old man.
Like during this time there were lots of undercurrents that forced me to put my foot down and say the hell with what other people say. I've got to start thinking for myself. That was the gist of it.
I am unable to provide a proper citation as I seem no longer to have a copy of the book available. However I believe E. E. "Doc" Smith used it in "Gray Lensman" (serial published in 1939-40, book in 1951). About the second or third chapter Kinnison attended some sort of soiree where he was treated like a rock star and swarmed by young women. "Cool you jets" was used in the course of the conversational repartee. As I recall there were many other future slang references to jets - clogging, not firing on all jets, and the like. Apologies for lack of citation.
The n-gram is instructive https://books.google.com/ngrams/graph?content=cool+your+jets&year_start=1800&year_end=2000&corpus=15&smoothing=3&share=&direct_url=t1%3B%2Ccool%20your%20jets%3B%2Cc0 Note the origination in the early 40's, almost certainly in pulp SF. In the absence of direct attribution, the suggestions of other answers of Smith or Heinlein seem very likely, although Tom Corbett "Space Cadet" is a few years too late to be the first use. It then seems to have fallen into disuse until the mid-60s.