Most of the BOS-JFK flights go to T2, so plan on arriving there and having to take the shuttle bus over to T4. Also figure up to 30 min transfer time to get from your arrival gate in T2, walk to the bus gate, drive to T4, and walk to your departure gate in T4. Its possible for it to be even longer if you get bad luck and have to wait for the buss and get stuck in apron traffic, and your departure gate is far away from the bus gate in T4 (up to 10 min walk)