We did LGA-JFK transfer this spring on a Friday. Landed in LGA at 3:20 PM, collected bags and grabbed a taxi right by the baggage claim. The taxi ended up being about $70 (cheaper than Uber/Lyft and we didn't have to hike to the official pickup point) and took a good hour to get to JFK (clearly, 4:00 on a Friday is a bad time for this). Our flight out of JFK was at 7:25 PM and we had time to hang out in the LH lounge. Personally, I wouldn't dream of anything less than 3 hours for this transfer. 4 hours was comfortable.
Of course, getting to LGA will almost certainly require a connection on UA, so the EWR option is probably better.