There's a "Change what happens when you close the laptop lid" setting in Windows. Is there an equivalent in OS X?
Nope, there's no such setting in OS X. This has lead to the creation of a number of sleep-prevention apps:

InsomniaX
Simple app but lets you set options for each:


macosx-nosleep-extension
A preference pane for enabling/disabling sleep-prevention.