It's been so long that I've forgotten. My first beagle is when I had to deal with that, and that was, oh my, decades back. All the dogs since then have been spayed or neutered, which is now highly recommended.
I'm assuming that you're asking when she's no longer at risk of becoming pregnant (or maybe a bit more prone to running off if not leashed). As you might know, dogs are fertile right up until the end of their heats. Both our females have been heavy bleeders throughout their cycles, so we've waited until the swelling subsides before taking them out, which has usually been about three days after their last light discharge.
Dogs differ from one to the next, and being your dog's first heat muddies the picture some since the first estrus is often a bit irregular and you're unfamiliar with the dog's symptoms and time tables. Even judging when the heat's over by tracking discharge and swelling is a bit iffy during the first heat since dogs differ in both. In addition, the dog's vulva will likely remain permanently enlarged from the way it looked before the heat, which makes it difficult to use as a judge to when the estrus cycle is over.
All this said, you might want to play it a little on the safe side this time — especially if there's a chance of encountering an unneutered male. For most dogs, the risk is usually over after 24 days, but depending on the dog, it could be a little more and up to about a week less. Like I said, though, until you have a chance to assess your dog through a couple of cycles, I'd be inclined to play it safe.
They are the most fertile around 10 to 14 days give or take a few days. When you see her tail go the right or left of her body, she is flagging and saying "i'm ready". Every dog is a bit different. Keep track on the calendar of the day she started spotting, then you count from there. Three weeks is a bit too early but as Aarooogh! said 24 days is better. If the swelling in her vulva is not really smaller or she is still spotting, wait longer.
Today is Sept. 8....she might be flagging, wanting to go outside alot and howl to call other dogs.