Note: Russian visa regulations are notoriously changeable. Confirm everything stated here before you make your plans.
Residents of most countries, including the US and Canada, are required to obtain a visa in advance to enter Russia. An exception is made for travelers arriving by cruise ship, who are allowed to be in the country for up to 72 hours without a visa if they are accompanied by a local tour operator. Cruisers in St. Petersburg can either 1) obtain a visa to explore the city on their own, or 2) see the city with a guide (on an excursion offered by the cruise line or one arranged through a private operator).
Getting a Visa on Your Own
Getting a Russian visa takes several steps and a few weeks to accomplish. If the steps outlined below make your head spin, skip down to "Using a Third-Party Agency."
1. Before applying for a visa, you must first get an official document called a "visa invitation" (priglashenie; sometimes called a "letter of invitation," "visa sponsor," or "visa support letter") from a Russian organization recognized by the Russian Foreign Ministry. Visa invitations are typically issued either by a hotel or by a tour operator; if you're arriving by cruise, you'll need to arrange an invitation through a third-party agency (see below). Don't expect the invitation process to make sense; it feels (and is) bureaucratic and possibly corrupt. The organization that issues your invitation is legally responsible for you during your stay in Russia, but in practice, you will never have any contact with them.
2. Fill out the Electronic Visa Application Form. You'll need to choose between a multiple-entry visa (good for stays of six months or less per year; valid for three years, $180) or a double-/single-entry visa (allows stays of 30 days or less, $140). If there's any chance that you'll be returning to Russia soon, choose the multiple-entry version to save the trouble of applying again later. Also note that your passport must be valid for at least six months beyond the visa expiration date, and must have two adjacent blank pages to accommodate the visa.
3. Submit the invitation, the signed application form, your passport, a passport photograph, and the processing fee (money order or cashier's check only) to the Russian Embassy. Applications are accepted anywhere from 30 to 90 days before departure (the specific timeframe changes constantly, but you'll certainly need at least a month for the full process). Russia's embassies and consulates in the US do not accept visa applications by mail. If you live near one of the Russian consulates in Washington, D.C., New York, San Francisco, Seattle, or Houston, you can deliver your documents in person. (For specific locations and more details, see the Russian embassy's website.) Otherwise, you must submit your application through a third-party service, which can be a smart idea anyway.
Various agencies specialize in steering your visa application through the process. They can also help you arrange visa invitations and navigate the confusing application. I've had a good experience with Passport Visas Express.
In addition to the $140/$180 visa price, visa agencies charge a service fee of about $50–85 (including the invitation fee). To ship your passport securely to and from the visa agency costs another $50 or so. Figure at least $250 total per person.