if you ever plan to travel from Oslo to Stockholm by train, here is the cheapest train route to take. It involves a couple of changes, though: Oslo S to Kil Station via the SJ InterCity 50 highspeed train. Change at Kil Station and catch the SJ bus 6050 towards Kristinehmn Station. Once you arrive there, hop on the SJ InterCity 50 highspeed train towards Stockholm.
The train takes nearly 8 hrs...You can get from Stockholm to Oslo easily on the plane via SAS and Norwegian, and it only takes less than 1 hr. A roundtrip airline ticket from Stockholm to Oslo costs about $180, which is not too bad.
You can also take the Swebus Ekspress between Oslo and Stockholm. it costs around 300-450 SEK per adult..that's about $50. If you do get the train, try booking last minute. They tend to have better prices for last-minute trips.
Train is the best bet here. From Oslo Central Station it will take about 5 hours. You can book in advance i think. If you’re a student it also has a discount. If you’re looking for a place to stay, you might want to check these guys as well. They are a worthy mention.