Lemon cakes are a kind of sweet baked dessert, made using lemons. They are typically served as small cakes, held and eaten with one hand (as opposed to a larger cake requiring utensils). Lemon cakes are relatively expensive treats enjoyed by upper-class noblewomen of the Seven Kingdoms, where they are a mainstay at the refined social gatherings of noble courts.
Olenna and Margaery Tyrell share some lemon cakes with Sansa Stark when they meet her in the gardens of the Red Keep to learn more about King Joffrey Baratheon, now Margaery's future husband. Sansa reveals that Joffrey is "a monster".
Shae offers Sansa some lemon cakes to try to get her to eat something, noting that they are her favorite, but Sansa is so griefstricken after the hearing about the horrific deaths of her brother Robb and her mother Catelyn at the Red Wedding that she doesn't have the will to eat anything.
In the Eyrie Sansa eats lemon cakes with her aunt and they discuss how Catelyn was banned from eating sweet foods as a child as she had begun to grow fat and had to be beautiful to get a good suitor. Sansa then queries how they make the cakes as it would not be possible to grow lemon cakes in the Vale. Her aunt informs her that Petyr had sent for them before going into a rage accusing Sansa of allowing Petyr to do things with her body.
In the books
In the A Song of Ice and Fire novels, a running joke is that Sansa Stark is obsessed with lemon cakes. They are a delicacy enjoyed by refined "proper" ladies at court, and Sansa can't think of anything better in the world than the paragon of "lady-like" pursuits: a social gathering with major noblewomen wearing extravagant dresses, reclining on feather pillows, sipping tea and gossiping while eating lemon cakes.Thus in many ways lemon cakes come to symbolize Sansa's concepts of what normal, glamorous court-life is like: she wanted nothing more than to have lemon cakes and tea with Queen Cersei while chatting about her proposed marriage to her son Joffrey - but this eventually turns into a living nightmare, as Joffrey kills her father and has the "honorable" knights of his Kingsguard beat her in front of the entire court, with Cersei unable and unwilling to restrain her son. When Olenna and Margaery meet with Sansa, they give her lemon cakes, treat her with kind words, and give her the basic respect befitting the daughter of one of the major Houses of the realm - symbolizing that they maintain the refinement and decency that the nobility of the Seven Kingdoms are supposed to possess, but the Lannisters lack.
Sansa chastises her sister Arya for enjoying "un-ladylike" pursuits, particularly that Arya would rather run off and explore the Ruby Ford with her friend Mycah the butcher's son, when she could be having tea and lemon cakes with Queen Cersei. These lines were cut from the TV show, however, this exchange was used as the audition scene for both Sophie Turner (Sansa) and Maisie Williams (Arya).
Sansa's obsession with lemon cakes is also more understandable in context: citrus fruits such as lemons don't grow in the North, and with medieval methods of food transport and preservation being what they are, lemon cakes are actually a relatively expensive treat for those living in the North. Dorne in the far south is the only region of the Seven Kingdoms where citrus fruits grow, far away from Winterfell.
Robert Arryn also loves lemon cakes, perhaps because "Alayne" does. She promises he can have as many as he likes, and he demands a hundred. Alayne thinks she would like to give him a hundred spankings instead.
For the feast held for the competitors at the tourney of the Gates of the Moon, Lord Nestor’s cooks prepare a splendid subtlety, a lemon cake in the shape of the Giant's Lance, twelve feet tall and adorned with an Eyrie made of sugar. The cake required every lemon in the Vale to make, but Littlefinger has promised that he would send to Dorne for more.