I suppose this is not a feature with default windows but it is possible by using some third-party apps like TaskBarActivate. You can follow the below article for the discussion on this. Some users have stated that this works well for them.
Add delay to auto-hide taskbar
https://answers.microsoft.com/en-us/windows/forum/windows_7-desktop/add-delay-to-auto-hide-taskbar/e988aff7-198e-4524-8c3b-aec6e642a031?page=2
Hope this resolves your Query!!
--------------
--If the reply is helpful, please Upvote and Accept it as an answer–