Closing the lid should trigger sleep mode on your MacBook. However, there might be instances where this doesn't happen due to various issues.