This will give you an overview of macbook batteries and tips for getting the most out of it.
The specific conjditions that got 8 hours are found on the website and state this.
"Testing conducted by Apple in July 2014 using preproduction 2.5GHz quad-core Intel Core i7based 15-inch MacBook Pro units, preproduction 2.2GHz quad-core Intel Core i7based 15-inch MacBook Pro units, and preproduction 2.8GHz dual-core Intel Core i5based 13-inch MacBook Pro units. The wireless web test measures battery life by wirelessly browsing 25 popular websites with display brightness set to 12 clicks from bottom or 75%. The HD movie playback test measures battery life by playing back HD 720p content with display brightness set to 12 clicks from bottom or 75%. The standby test measures battery life by allowing a system, connected to a wireless network and signed in to an iCloud account, to enter standby mode with Safari and Mail applications launched and all system settings left at default. Battery life varies by use and configuration. See www.apple.com/batteries for more information"
The biggest drains on battery that I see here are screen brightness, using chrome, and using flash video online.
Apple claims battery life "up to X hours". That doesn't mean every user will get that much from their system, since everyone has different settings and workloads. There are many factors that impact your battery life. See the BATTERY LIFE FROM A CHARGE section of the following link for details, including tips on how to maximize your battery life.
The link below should answer most, if not all, of your battery/charging questions. If you haven't already done so, I highly recommend you take the time to read it.