LaGuardia is closer but not by much. Figure about 45min to 1hr depending on traffic, day and time of day. JFK can be 1hr to 1.5hrs depending on traffic and time of day. So you can’t go wrong with picking either one. It’s just 8.6 miles from LaGuardia to Midtown Manhattan, compared to 14.7 miles to JFK but, they both are going through NYC traffic. Just choose the one that best fits your needs.
If you’re not on a time constraint and you’re on a budget, take the NYC Express bus, the only bus authorized by the Port Authority of NY & NJ. $16 from LGA to Manhattan, $19 from JFK to Manhattan from 11a-7pm, 7 days a week!