If you have to pay roaming charges to use internet in Russia, please read this article. Russia is almost always excluded from the European roaming packages, such that you may be covered in Finland or Estonia, but not in Russia.
Mobile internet is pretty cheap in Russia. It may make a lot of sense to pay $5 to buy one month worth of Internet.
I am not endorsing any of the internet providers, nor I am an expert in the mobile internet market or applicable laws. I just wanted to summarize my experience hoping it may be helpful.
Step 1. Choose Your Mobile Internet Provider
The main ones are MegaFon, MTS, Beeline, Tele2. They all have offices in central Saint Petersburg.
You will need to walk into the office in order to buy a SIM card.
I would say there is not a lot of difference between the main internet companies, especially if you need your mobile internet for a short period of time.
Just walk into any of their offices and inquire.

MTS and Beeline offices
Step 2. Choose Your Plan
3. Buy a SIM Card
4. Important!
- Drop by the office to close your account (I thought it was too much work)
- Install an app on your phone or call the support line when you are at the airport and you no longer need internet, and ask to change your plan to zero monthly fee one. This way they would only charge you for the data you used and the phone calls you made. When you come back to Russia again and want to use your phone number switch back to a monthly plan.