All of the airports in Oslo are actually quite a bit outside of Oslo, and getting from the airport to the city center can take a bit of going.
Gardermoen is Norway’s largest airport, and is generally the airport you will fly into. It is also the easiest to get to Oslo from. There are two main options, the normal train, and the flytoget train. The flytoget is the quickest way, but only by a little, and is substantially more expensive, and will generally only save you 10-20 minutes at the most. If you are in a huge hurry, or your expenses are being reimbursed, then the flytoget is a good option. Otherwise, taking a normal train is the best option. Both trains leave from the same general area. Once you have exited the baggage claim area, look for the signs to the trains (tog). Once you arrive, you may purchase your tickets at the automatic ticket kiosks. Be sure to select the correct kiosk. If you are using flytoget, use the orange flytoget kiosks, and if you are using the normal train, use the red NSB kiosks. It is also worth noting that if you will be staying in Oslo, you will likely need a zone 1 Ruter bus pass. If this is the case, then you will be best served by purchasing a zone 1 Ruter card from the Ruter kiosk for the duration of your stay, then you can simply purchase an extension for the trip from the airport to Oslo, which will be about half the cost. Ruter is the bus/metro company in Oslo, and NSB is the national train service. Ruter and NSB have an agreement where Ruter tickets are allowed to be used on NSB services within the zones that the Ruter pass is valid in. Expect travel times of about 45 minutes to arrive in the city center.
Going back is the same general process, however, it may be that you have a very early flight. If this is the case, you’ll need to take the flybussen, which runs, at minimum every hour throughout the night (be sure to check against your specific dates, however). Do keep in mind that the local busses run at different schedules at night, and some lines may shut down entirely. Even if you have a 24 hour line, it may only run once an hour, so you’ll need to carefully plan your journey. It may be that you have to order a cab to get to a stop where the flybussen picks up. If so, be prepared for a large cost.
Torp is one of Oslo’s “low budget” airports, and is a decent amount further away from Oslo than Gardermoen. Expect travel times of 2 hours to the city center. NSB provides regular service from the airport, which is probably the easiest way to get there. Since Torp is completely outside of Ruter’s coverage, you’ll need to make sure to purchase an NSB ticket at the airport.
Another option if you cannot take the train for some reason is to use the Torp Ekspressen bus. The bus is a bit cheaper than the train, but will take a bit longer as well.
Rygge airport is no longer in operation. It was closed in late 2016, and has tentative plans to re-open in 2018 or 2019.
Once you are in Oslo, you will need to get around. You can purchase a Ruter pass for all modes of transport (bus/buss, tram/trikk, metro/t-bane, and above ground train/tog, and ferries/båt) within the various zones. Note that above ground trains are operated by NSB, not Ruter, but Ruter and NSB have an agreement that allows you to use the Ruter card on the NSB trains within zones that the Ruter card is otherwise valid for. It is important to be aware of what zone you are in, to make sure you are not accidentally taking a free ride. You can find what zones your trip is going through on this page. All underground services (t-bane) are in zone 1.
Ruter has an app, Ruter Reise (Ruter Travel) for Android and iPhone, which you can use to find and plan a journey. If you are using NSB services, it is better to use the NSB app for Android or iPhone.
You can purchase Ruter tickets through the Ruter Billett (Ruter Ticket) app for Android or iPhone if you have a scandinavian credit card. Otherwise, you will need to purchase a physical card and load service on it. These cards can be purchased from Narvesen, 7-Eleven, Deli de Luca or Mix or from Ruter service points at Oslo S and Gardermoen. You can also purchase single use tickets from those stores, or directly from the bus driver using cash only (and not at all on trams and t-bane), however you will probably want to purchase a period ticket instead for the zones you intend on being in during your stay. If you are planning to go around to the outlying areas of Oslo, then the easiest option is to probably purchase an all zone period ticket. If you do this, you can also use this to get from Gardermoen to the city center, and not have to worry about extra purchases along the way, and you can take any bus (both red Oslo city busses and Ruter green region busses), tram, underground, ferry or train within Oslo and Akershus without having to worry if you are on an invalid ticket.