As adults we are hopefully better at disciplining ourselves to prioritise but it can be difficult - "I know it's midnight but just one more chapter". Gaming achievement and progression is more interactive than a book and the game never ends until it becomes boring.
There's also an element of sport and competition in many games which brings with it bragging rights.
For those adults who aren't gamers and can't relate to the addictive qualities of many games, it is in many cases, very similar to reading a very good book or watching a tv series with a very good story line.
It can be difficult to keep our selves in suspense by forcing our own selves to do a more important task such as sleep instead of continuing on to the next exciting chapter.
My boys logon account cannot game after PM at night during the week and he can't game prior to 5PM during the week except on Fridays.
With the knowledge that the gaming will stop at 9PM, he now stops gaming at around PM and says goodnight to his mates until forced shutdown or comes and chats to my wife and I.
Weekend is often a bit different but that's ok in my book.
Turn off internet or Wi Fi at bed time and try waking up earlier for school.
My son found he is better prepared if he has 20-30 minutes to himself before school.