No there no life span, but if you detached it it can be deleted, if you want to hide something you should collapse it (SetVisibility mode), also if you wont use UPROPERTY() on UMG widget pointers it may be thrown away by garbage collection.
If you composing widgets in C++ (like you making parent UUserWidget that contain widgets) then you might consider using Slate directly as it more optimized for C++ use and made to be more friendly to be used in C++. If you not aware of it UMG is just Slate blueprint wrapper. Slate is UI system originally made for editor specially for UE4 (previously it use messy hybrid of everything), but it so powerful that it would be a waste to not be used in games themselves. problem is Slate classes have there own object management and have no interaction with UObject system, there for Slate can not be use directly in blueprints and that why UMG was made. If thats the case then you need to make UWidget not UUserWidget.
Read about slate here:
The main feature is ability to nest them in single expression, you don’t need to make multiple function calls and you don’t need to make extra class (ofcorse to use them in UMG you forced to make UWidget class) to create large and complex Slate widget compositions. here examples:
You just need to make UWidget and override RebuildWidget() function that returns Slate widget composition and use SychronizeProperties function to editor property sync your UWidget with SWidget as well you need to make set function to dynamically change them in runtime
Look on engines UWidgets (again they simple wrappers so don’t be scared) to see exacly how to set it up: