OS X has long had text-to-speech features, but Apple added dictation in Mountain Lion with, of course, an obvious influence from iOS. By default, you can double-tap the Fn key on an Apple keyboard to trigger the Dictation microphone just about anywhere you can enter text.
If you upgraded to Mountain Lion from a previous version of OS X, you may need to go to System Preferences > Dictation & Speech to enable the feature. There you can also change Dictation’s behavior and the shortcut key that triggers it.
If you want to learn more about Dictation and its real-world use, check out Lex Friedman’s Up close with Mountain Lion piece about it.