Warning: Game of Thrones spoilers ahead, so proceed with caution.
After an exhausting Game of Thrones battle and an inspiring speech from Jon Snow to mourn all those they lost, it's party time in Winterfell in episode four of the eighth season. In addition to celebrating the fact that the Long Night didn't come after all, all those remaining have other things to cheer on. Among these is Daenerys's decision to publicly legitimize Gendry and name him the Lord of Storm's End. He's no longer Gendry Waters, but rather Gendry Baratheon, and he's now the head of his house and its ancestral seat.
For most of his life, all Gendry has ever known in terms of his family was that he was an orphan. This changes when Melisandre tells to him that he's actually Robert Baratheon's bastard son in season three. It's a fact that we've known since Ned Stark figured it out on his own season one, but it's understandably a huge reveal for Gendry himself. It becomes even more important as the series goes own and Stannis Baratheon dies, leaving Gendry as the last known Baratheon the show has introduced. If he had any interest in taking the Iron Throne, as his family was the last to occupy it before the current Lannister reign, it could make for an interesting twist. However, as Gendry reveals, he's not legitimized and therefore has no real claims to anything. Dany, as Queen, changes this — but not solely because it's in Gendry's best interests.
In fact, naming Gendry as Lord of Storm's End benefits Dany greatly. Before she legitimized him, he didn't have much, despite being more than willing to help defend Winterfell. Now, he's in charge of a castle and region that previously had no leader. He can marry someone with a title — and he clearly has Arya in mind. His whole life will change significantly, and Dany knows this. It's an especially poignant gesture given the way their families have intertwined over the years. Like she and Tyrion quietly discuss, she's banking on legitimizing him meaning that he'll continue to serve her and feel indebted to her. Doing so in public, while everyone's in good spirits and celebrating, is like insurance. Everyone will remember that moment because it displays Dany's power and apparent kindness, and they won't forget Gendry essentially owes his new life to her.
With her armed forces cut down significantly after the gruesome battle with the White Walkers, Dany knows that she needs as many allies as she can get. Throw in the fact that Jon's true parentage is a point of conflict in her quest to rule, plus the fact that she's now lost even more important people and another dragon, and it's easy to see why she's thinking about her approach as strategically as she can. Gendry thus far seems quite loyal to both her and the Starks, so siding with one or the other may be difficult if he ever finds out about Jon's claim to the throne. As a side note, did you know that the castle Storm's End has never been shown on the series? Should he pop up again, it'd be nice to see Gendry living it up in the Stormlands!