Primary source for this information comes from Apple.com.
Beginning on July 25, 2012, every new Mac computer came with Mac OS X Mountain Lion pre-loaded. Apple sold OS X v10.8 through the Mac App Store. Apple's upgrade instructions are below (Steps 1 to 3).
MacBook (Late 2008 Aluminum, or Early 2009 or newer)
MacBook Pro (Mid/Late 2007 or newer)
MacBook Air (Late 2008 or newer)
Mac mini (Early 2009 or newer)
Mac Pro (Early 2008 or newer)
Xserve (Early 2009)
If you are running Lion, you can find out if your current Mac qualifies by clicking the Apple icon at the top left of your screen, choosing About This Mac, then clicking More Info.
Upgrade Step 2
Make sure you have Lion or the latest version of Snow Leopard.
While you have the About This Mac window open, check what version of OS X your Mac is running.
If you are running Lion (10.7.x), you're ready to update to Mountain Lion. Go to Step 3. If you are running Snow Leopard (10.6.x), update to the latest version of OS X Snow Leopard before you purchase OS X Mountain Lion from the Mac App Store. Click the Apple icon and choose Software Update to install Snow Leopard v10.6.8, the latest version.
If you're running OS X Leopard and would like to upgrade to OS X Mountain Lion, first you'll need to upgrade to OS X Snow Leopard.
Upgrade Step 3
Download OS X Mountain Lion from the Mac App Store.
Open the Mac App Store from your Dock to buy and download Mountain Lion. Then follow the onscreen instructions to install it. If you don't have broadband access, you can visit any Apple Retail Store to get help with downloading.
General Requirements:
OS X v10.6.8 or later
2 GB of memory
8 GB of available space
Some features require an Apple ID; terms apply.
Some features require a compatible Internet service provider; fees may apply.
Feature-specific requirements
Time Machine
requires an additional hard drive or Time Capsule (sold separately).
Photo Booth
requires a FaceTime or iSight camera (built in or external), USB video class (UVC) camera, or FireWire DV camcorder. Backdrop effects when using a DV camcorder require fixed focus, exposure, and white balance.
FaceTime
Video calls require a built-in FaceTime camera, an iSight camera (built in or external), a USB video class (UVC) camera, or a FireWire DV camcorder, and a 128-Kbps upstream and downstream Internet connection. Making HD video calls requires a built-in FaceTime HD camera and a 1-Mbps upstream and downstream Internet connection. Receiving HD video calls requires a supported Intel-based Mac.
AirDrop
supports the following Mac models:
MacBook Pro (Late 2008 or newer)
MacBook Air (Late 2010 or newer)
MacBook (Late 2008 or newer)
iMac (Early 2009 or newer)
Mac mini (Mid 2010 or newer)
Mac Pro (Early 2009 with AirPort Extreme card, or Mid 2010)
Boot Camp
supports existing Boot Camp installations with Windows XP Service Pack 2, Windows Vista, or Windows 7. New Boot Camp installations require Windows 7 (sold separately).
Exchange Support
requires Microsoft Exchange Server 2007 Service Pack 1 Update Rollup 4 or Exchange Server 2010. Auto-setup requires enabling the Autodiscovery feature of Microsoft Exchange Server.
AirPlay Mirroring
requires a second-generation Apple TV or later. Supports the following Mac models:
iMac (Mid 2011 or newer)
Mac mini (Mid 2011 or newer)
MacBook Air (Mid 2011 or newer)
MacBook Pro (Early 2011 or newer)
Power Nap
supports MacBook Air (Late 2010 or newer), MacBook Pro with Retina display.
Gestures
Requires a Multi-Touch trackpad, Magic Trackpad, or Magic Mouse.
VoiceOver Gestures
requires a Multi-Touch trackpad or Magic Trackpad.
Mac App Store
available only to persons age 13 or older in the U.S. and many other countries. Requires compatible hardware and software and Internet access; broadband recommended (fees may apply). Terms apply.
Dictation
requires a microphone (built in or external) and a broadband Internet connection.