With an excellent port, San Francisco owes its prominence to oceanic travel. The Maritime Museum is a must-visit for history and maritime buffs.
For everyone else, Aquatic Park hosts excellent views of the bay (Golden Gate Bridge, Angel Island, etc) and is a great walking tour. If you're inspired to board the ships, buy a ticket and enjoy.
There are a lot of special events as well, the Chantey Singalongs are especially popular, check the website for specifics.
The USS Pampanito submarine is a few blocks away on Pier 45.
Website: http://www.nps.gov/safr/planyourvisit/events.htm
Wikipedia: http://en.wikipedia.org/wiki/San_Francisco_Maritime_National_Historical_Park