I agree with all the above comments. Going with only carryon means you'll get to passport control before the folks with checked bags. The length of the queue there will depend on how many other flights discharge passengers at the same time. Evenings seem to be the busiest. I arrived last year at about 8:30am and was out of the airport in a bit over 90 minutes, including getting off the aircraft and walking to passport control.
(Note: Keep an eye out for a restroom as you walk through the airport to passport control, 'cause once you're in the queue there, you're stuck.)
Pad your schedule to account for the unexpected, rather than anticipate good fortune. Don't forget to factor in the time to get into town from Heathrow and then to King's Cross.
If you are retrieving tickets at King's Cross, you may, or may not, face a bit of a queue. You'll see machines (feed in the credit card you used to buy the tickets and the magic number they gave you). You'll see a few actual human beings selling tickets, with customers waiting in a queue.
Starting around 4pm or so, King's Cross will start to fill up with commuters. Places to sit are hard to come by at any time, more so during the rush.
Take a few minutes to reconnoiter the station, so you can find your train when it's called.
The British Library is within a few hundred yards of King's Cross, just west on Euston Road. You could, in theory, leave your bags at the station's Left Luggage, walk down and tour the Library, stop at a cafe and grab some coffee, etc. before departing. St Pancras station is next door to King's Cross, and merits a bit of attention, too.
BTW, York station is about a ten-minute walk from the city center, but I'd suggest taking a cab to your hotel or B&B. York isn't exactly laid out in a grid pattern, and the last thing I'd want to do after such a long day of travel is wander its twisty-turny medieval streets trailing luggage and looking for my destination.