Be noted, cruise passengers do not need to have Russian visa in the following cases: while staying in Russian port cruise passengers overnight aboard the ship, and visit the city within organized shore excursions, provided by authorized local company. The excursion may either be group or private, cover up to 3 days (or less) of ship's stay in the port, and may be purchased onboard the ship or directly with a local company. Cruise passengers are not allowed to stay in the city on their own without valid Russian visa - company representative (guide) must stay with them all the time of the tour since meeting in the port up to return back to the port at the end of each day program.
Here is an extract from the official Russian Consulate Website page providing instructions for the cruise ship passengers staying in the Russian Federation up to 72 hours.
New Tourist visa
ATTENTION CRUISE SEA SHIP PASSENGERS!
According to the Russian Immigration Law if you travel on an International Cruise Sea Ship and follow below mentioned conditions:
1. During your stay in the Russian Seaport you have accommodations on the the Shipboard in the same Sea Port;
2. You have group tourist program organized by a local tour operator, or your Cruise company in the same city.
You don't need tourist visa for the period of up to 72 hours.
This special immigration regulation does not apply to individual Sea Cruise tourists without organized tourist program, river board cruise passengers and travelers coming to Russia on package tours. For this type of travelers please see Consulate's visa requirements below.
To avoid any misunderstanding, please be informed: any person taking DenRus shore excursion is provided with DenRus valid tour ticket, which must be printed and presented to Russian Immigration Agent. Printed tour ticket is the actual permit to go ashore without Russian visa. DenRus takes care about all necessary arrangements with the Russian Immigration Department for every person booked any of DenRus tours. However, if a cruise passenger wants to spend some time in the city independently - without booking a tour either with the cruise ship or local compamy - this person must have a valid Russian visa.
DenRus tour ticket is issued after the tour is actually booked and confirmed by DenRus representative. Then tour ticket becomes available online at the customer's personal account.
Below is a sample of a DenRus Shore Excursion ticket. Number of days and timing are set according to each program.
Sample DenRus Shore Excursion Ticket
Immigration/Customs officials allow tour ticket holders to enter Russia very easily, by showing the official DenRus tour ticket, and displaying your passport. The Immigration official is looking for the DenRus tour ticket, primarily just our logo, to prove you are hosted by an authorized tour company. We provide passport information and membership lists to immigration control at the port prior to your disembarkation. If you are not on our lists or other tour companies, you must have a visa to enter.
As an authorized tour company we host, sponsor and supervise cruise passengers to St Petersburg, the vast majority of whom do not have visas.