• Yes.  If you go to Finder > Applications > Caffeine, Caffeine is a program that once launched puts a little coffee cup icon on the menu-bar at the top right near you clock.  
  • If you click on it, the cup will fill up and your laptop will not go to sleep as long as you have the lid open.  If you close the lid it will sleep.