Between JFK and LGA, New York Airport Service Express Bus operates a coach every 30 minutes for $11; it takes from 30 to 45 minutes and stops at the LIRR station at Jamaica. To save a buck, you could take AirTrain to Jamaica ($5) and then the bus from there ($5) and it might be shorter.
A cab would cost $19 to $22 plus tip and take less than 30 minutes.
Good luck!