If your flight originates in Vancouver you will clear US customs before departure in Vancouver, otherwise you will clear customs at JFK. When you arrive at T7 take AirTrain on track 1 one stop to T8. You will go through security at T8 in order to get to your departure gate. If you clear customs in Vancouver and you arrive at JFK on time you should have time to make your connection. You may not have time if you have to clear customs at JFK.
If your flight originates in