London City Airport doesn't have a railway station. It is on the Docklands Light Railway in Zone 3, on the Woolwich Arsenal branch.
Starting from Cambridge, you can buy a through ticket. You'll want either a single or a return, to London Zone 3. If you're coming back, you'll need to buy a return in Cambridge, as there are no National Rail ticket facilities at London City Airport. If you were flying into City and going to Cambridge, you'd have to buy a Zone 3 to Zone 1 ticket from the TFL ticket machines there (or use Oyster), then buy a train ticket at Kings Cross. Coming from Cambridge, you can buy a through ticket including tube+DLR.
Using a National Rail powered journey planner for the route (tweak the day as needed), we see that the predicted time is about 1 hour 45. However, the tube+DLR times from National Rail can be a bit vague. What you'd really need to do is use the TFL journey planner to work back to find your required arrival time into Kings Cross, then pick a train based on that.
TFL seem to suggest it'll take about 35 - 40 minutes travel time from Kings Cross to London City Airport by Tube (Northern Line to Bank) then DLR (direct Woolwich Arsenal service). However, that's platform to platform, so add an extra 10 minutes at Kings Cross to get from your train onto the underground, and then 3-5 minutes for the walk from the DLR station to checkin. Yup, that's right - with a brisk walk you can be at the checkin desks in 3 minutes from when the DLR pulls in!
Once you're at LCY, there is free wifi, a few cafes before security, and a few more after, so you should be fine if you get there early.
As for buying your ticket, it might be simplest to buy it online in advance. When you get to the station, you'd then just need to pop in your credit card, type in the booking code, collect your tickets and go. That's likely to be simpler than trying to work out how to get the ticket machine to sell a ticket to London Zone 3, which isn't always obvious... Assuming you don't have a railcard, it's £25.20 for an anytime single ticket (valid on all trains any time of the day), or £39.90 for an Off Peak Return (not during rush hours, out and back within a month), or £50.40 for an Anytime Return (any trains, return in a month)