This the 2001 Spielberg film A.I. Artificial Intelligence, the story of the life of David, an artificial boy created to be a companion to childless couples.
Quoting from the plot summary on Wikipedia:
Two thousand years later, humanity has become extinct and Manhattan is now buried under glacial ice. The Mecha have evolved into an advanced form, and a group of them called the Specialists have become interested in learning about humanity. They find and revive David and Teddy. David walks to the frozen Blue Fairy statue, which collapses when he touches it. The Specialists reconstruct the Swinton family home from David's memories and explain to him, via an interactive image of the Blue Fairy, that it is impossible to make David a real boy. However, at David's insistence, they use their scientific knowledge to recreate Monica through genetic material from the strand of hair that Teddy kept. This Monica can live for only one day, and the process cannot be repeated. David spends his happiest day with Monica, and as she falls asleep in the evening, she tells David that she has always loved him: "the everlasting moment he had been waiting for", the narrator says; "David falls asleep as well and goes to that place 'where dreams are born.'"