Visually, differences in appearance between various versions of Mac OS X are quite subtle, so it's often hard to recognize them just with a glance. (If you've spent enough time with Macs, you'll remember that this version had flat window buttons, that one didn't have rounded menu corners, etc.) Often, the best clue is the desktop wallpaper, of which Apple introduces new ones whenever it releases a new operating system. On the right? The unmistakable Yosemite :)
Click on the Apple logo in the top left corner of the screen, and select "About This Mac". That's where Apple hides all kinds of information about your software and hardware. In later versions of OS X, it added tabs, making this dialog/popup much more useful (including stuff like disk space and RAM).
The Overview tab, selected by default, gives you more technical information than you probably might need about your iMac or MacBook / Pro / Air. Visible first at the top, the human-friendly name of your version of Mac OS X (in my case, Yosemite; the next version, due out in a month or so, is El Capitan).
Tip: you can now upgrade to Mac OS X El Capitan (free) from the App Store.
On the next line is the corresponding version number (10.10, in my case). You can ignore the first 10 ("X" is just the roman numeral for "10", so all versions of Mac OS X since Cheetah in 2001, start with 10). The second number after the period is the version of Mac OS X you are running. Any number after the second dot is just a sub-version ("5", in my case), which changes after some updates. Just like the "1" is in iOS version 8.4.1 (iPhone/iPad/iPod touch).
Here are the Mac OS X versions in order, with their year, name and number:
10.0 (Cheetah/2001), 10.1 (Puma/2001), 10.2 (Jaguar/2002),
10.3 (Panther/2003), 10.3 (Panther/2004), 10.5 (Leopard/2006),
10.6 (Snow Leopard/2008), 10.7 (Lion/2010), 10.8 (Mountain Lion/2012),
10.9 (Mavericks/2013), 10.10 (Yosemite/2014), 10.11 (El Capitan/2015),
10.12 (macOS Sierra, which is the current release as of September 2016!)