The dual setting of "Lady with the Dog" is very important to the story. When Gurov and Anna leave Yalta, it signals a shift in atmosphere and mood. To start, think about Yalta and the way it is treated in this story. First of all, it's a vacation spot. Gurov well knows of "the stories of immorality" in this seaside vacation town, "tales of easy conquests, of trips to the mountains," and, despite knowing better, is intrigued by the thought of "the tempting thought of a swift, fleeting love affair, a romance with an unknown woman, whose name he did not know" (1.7).
On top of that, there's not really much to do in Yalta. When the story begins, Gurov has already "been a fortnight in Yalta" and so has "begun taking an interest in new arrivals" (1.2). When he first sees Anna, he knows she is already "dull" (a.k.a. bored) (1.7). As Chekhov writes, "one did not know what to do with oneself" (2.1).
Then there's the romance of the place – "the chirrup of the grasshoppers," "the heat," "the smell of the sea," etc. When Anna and Gurov stroll about, "the scenery invariably impresse[s] them as grand and beautiful" (2.33). "They walked and talked of the strange light on the sea: the water was of a soft warm lilac hue, and there was a golden streak from the moon upon it. They talked of how sultry it was after a hot day" (1.17). Everywhere are the colors, scents, and sounds of love. These details are packed into the romantic scenes between the two lovers. Just before Gurov kisses Anna, she "sniff[s] she flowers," and when he kisses her, he breathe[s] in the fragrance and moisture of the flowers" (2.4, 2.7). Even Anna's room is suffused with the sultry scent "she had bought at the Japanese shop" (2.9). It's no wonder the two lovers fall into bed.
It's fitting, then, that as soon as Anna departs, Gurov doesn't feel at home in Yalta anymore. "Here at the station was already a scent of autumn," he notes; "it was a cold evening" (2.41). Gurov quickly decides, "It's time for me to go north. […] High time!" (2.42).
And then we move into the second half of the story – a very different setting indeed:
At home in Moscow everything was in its winter routine; the stoves were heated, and in the morning it was still dark when the children were having breakfast and getting ready for school, and the nurse would light the lamp for a short time. The frosts had begun already. (3.1)
In Moscow, Gurov is lonely and cold and isolated. He longs for Anna and finds himself dissatisfied with the life he's living. Again, the setting compliments the atmosphere of the narrative and the mood of its characters.