Google had an extension to do that called Chrome Toolbox, but it has been discontinued.
Apparently, this currently can't be done according to this post from a Google employee. Quote:
Thank you all for your feedback. At this time, we don't have plans to implement this feature. Part of Chrome's design philosophy is to avoid interrupting you with annoying questions that only sometimes matter. Still, we do see how accidental closing of tabs can be frustrating, and we are thinking of a better solution. [...]
(The remainder of the post suggests the above obsolete extension and some workarounds on Mac)
However, there is another workaround posted by a Google user on this post. That is basically to open a website that asks for confirmation before closing, and leave that page open or pinned.
Here is the example website. I've tested it, and it works for me.
Note that Firefox has that feature by default. It may be worth switching if you use it much