The Theft of the Time Stone was a plan executed by the Avengers as a part of their Time Heist. Hulk was sent to steal the Stone from the Masters of the Mystic Arts, knowing it would likely be in New York.
However, he was unaware that the Battle of New York predated Doctor Strange's tenure as Master of the New York Sanctum and that the Sorcerer Supreme at this time was the Ancient One. The Ancient One refused to hand over the Time Stone until Hulk revealed that Strange had surrendered it to Thanos, at which point she realized Strange would only do this if he genuinely had no choice and trusted Hulk with the Stone.
Ant-Man, Iron Man, Hulk, and Captain America were tasked with going back in time to the Battle of New York in 2012 to retrieve the Mind Stone, Space Stone, and Time Stone. Hulk was tasked with retrieving the Time Stone from Doctor Strange.
Upon arriving at the Sanctum, Hulk was instead met by the Ancient One, who informed Hulk that Strange was not yet a Master of the Mystic Arts and would not join them for a few years, telling him that Strange was still currently a neurosurgeon.
Hulk implored the Ancient One to give the Time Stone to him, notifying her of the Decimation that Thanos caused in the future.
As the Ancient One refused, citing that she could not give him the Infinity Stone to alter his timeline and leave hers undefended, despite Hulk promising that he would return the stone to her at the exact moment it was taken. The Ancient One proclaimed that all the Masters of the Mystic Arts have sworn an oath to guard the Time Stone as their chief weapon.
Only, she is then shocked when Hulk inquired why Strange had willingly relinquished the Time Stone to the Mad Titan. Realizing that Strange would only have given up the stone to Thanos for a good reason, the Ancient One decided to entrust in her future successor, handing over the Time Stone to Hulk.