@Migelis22 Hi! I don't know for sure but I do think there is a time limit for NPCs by design. I believe the game has a limit to how many sims can be on the lot, so some sims leave and new ones come in. I did a few searches but I didn't find a mod to change the time limit. However, I did find a couple other mods that you might find interesting. We're not allowed to link mod content here so just run a search for them if you want. I have not personally used these mods so I am not making any recommendations here. As always, when using mods, it's a good idea to test them out in a game save that you don't care about before adding them to your primary saves.
There is a mod by LittleMsSam called "More Visitors". The description on their Tumblr page states, "This Lot Trait let’s more Sims spawn on the Lot." Again, I haven't used this mod and can't really advocate for it but LittleMsSam is a known modder who's been around for a long time.
Another one that looked interesting is "No Empty Venues When Arriving" by weerbesu; another long time modder. To paraphrase the description on their Patreon, this mod forces NPCs to spawn during the loading screen so the lot is full when your sims arrive.
I don't know if either of these will extend the time that NPCs stay on the lots but perhaps you'll get more NPCs with whom your sims can socialize more quickly. If neither of these suit you, perhaps try searching for something like "mods that increase NPC spawn time on lots". Happy Simming!