The Doge was the top dog in Venice, only a small canine pun intended; that is, the civil and military ruler of the Venetian state. The title is related to the words "Dux" and "Duke".
Ever since the then-Doge decided to move his palace to the main island in 810, that palace has been located more or less here. Of course, this residency came to an abrupt halt once Napoleon marched in and spelt the end for the Serene Republic. After Napoleon's defeat Venice passed to Austria until it became part of Italia a few years after the 1861 unification.
The building itself has undergone many changes, many of which were the result of massive fires. How something so waterlogged can burn so often I have no idea, but that's its history. The construction of the current building began in the mid-1300s but extensive reconstruction work (some fire-related) needed to be done over the centuries and without digging into huge historical texts it's hard to say exactly how old the parts that we are looking at now are.
The building is now a museum and stands on the eastern side of the Piazza San Marco.