Laurence Olivier saw Leigh in The Mask of Virtue, and a friendship developed after he congratulated her on her performance. Olivier and Leigh began an affair while acting as lovers in Fire Over England (1937), but Olivier was still married to actress Jill Esmond. During this period, Leigh read the Margaret Mitchell novel Gone with the Wind and instructed her American agent to recommend her to David O. Selznick, who was planning a film version. She remarked to a journalist, "I've cast myself as Scarlett O'Hara", and The Observer film critic C. A. Lejeune recalled a conversation of the same period in which Leigh "stunned us all" with the assertion that Olivier "won't play Rhett Butler, but I shall play Scarlett O'Hara. Wait and see."  Despite her relative inexperience, Leigh was chosen to play Ophelia to Olivier's Hamlet in an Old Vic Theatre production staged at Elsinore, Denmark. Olivier later recalled an incident when her mood rapidly changed as she was preparing to go onstage. Without apparent provocation, she began screaming at him before suddenly becoming silent and staring into space. She was able to perform without mishap, and by the following day she had returned to normal with no recollection of the event. It was the first time Olivier witnessed such behaviour from her. They began living together, as their respective spouses had each refused to grant either of them a divorce. Under the moral standards then enforced by the film industry, their relationship had to be kept from public view.  Leigh appeared with Robert Taylor, Lionel Barrymore and Maureen O'Sullivan in A Yank at Oxford (1938), which was the first of her films to receive attention in the United States. During production, she developed a reputation for being difficult and unreasonable, partly because she disliked her secondary role but mainly because her petulant antics seemed to be paying dividends. After dealing with the threat of a lawsuit brought over a frivolous incident, Korda, however, instructed her agent to warn her that her option would not be renewed if her behaviour did not improve. Her next role was in Sidewalks of London, also known as St. Martin's Lane (1938), with Charles Laughton.  Olivier had been attempting to broaden his film career. He was not well known in the United States despite his success in Britain, and earlier attempts to introduce him to American audiences had failed. Offered the role of Heathcliff in Samuel Goldwyn's production of Wuthering Heights (1939), he travelled to Hollywood, leaving Leigh in London. Goldwyn and the film's director, William Wyler, offered Leigh the secondary role of Isabella, but she refused, preferring the role of Cathy, which went to Merle Oberon.

Answer this question "How long did this affair last?" by extracting the answer from the text above.
They began living together, as their respective spouses had each refused to grant either of them a divorce.