Hamura Ōtsutsuki was born along with his brother, Hagoromo, to Kaguya Ōtsutsuki, an alien princess who came to Earth in pursuit of the Divine Tree, a thousand years before the main story began. As such, they were the first two humans born with the ability to wield chakra.
In the anime, it was revealed that Tenji, the Emperor of the Land of Ancestors (祖の国, So no Kuni), was their father.
Years later, Hamura and Hagoromo had grown up and, along with their mother, became the rulers of the Land in which they lived.
At one point in time, however, Kaguya began to grow angry that her sons inherited the chakra that she felt was solely hers. So, unbeknownst to Hamura and his brother, she fused with the Divine Tree and became the Ten-Tailed beast, in an effort to reclaim the chakra that was passed down to her sons at birth.
Hagoromo and Hamura successfully defeated the beast and then sealed it inside Hagoromo, making him the first Jinchūriki. Hamura then went to the moon that Hagoromo created and sealed the husk of the Ten-Tails in, and lived there to stand guard over it until his death, but not before bearing a child that would become the progenitor of the Hyūga clan.
A thousand years later, one of his descendants, Toneri, saw that the world that Hagoromo created was a failure, and so he chose to destroy it by dropping the Moon on the Earth. This went against Hamura's wishes, and when his spirit encountered Hinata, he then gave her the task of destroying the Tenseigan and preventing the world's destruction.
His full abilities have not yet been expanded upon, but it is known that he was a very powerful individual, being one of the first to be born with chakra, and being the one who assisted his brother in defeating the Ten-Tailed Beast.
He was also a wielder of the Byakugan, with which he was skilled in its use and would pass down to his descendants, the Hyūga.