I have installed a wordpress site and for some reason I can see these 2 directories: .git .qidb
Do I need them? Can I remove them? Will it hurt me in any way?
You should not need the .git directory but I would not delete it.
It contains the version control for your site, and is thus an incredibly valuable resource should you need a developer to fix or upgrade your site in the future.
It also shows you a full history of the development of your site. This will save future developers time, and anything that saves them time, save you money!
So leave the .git folder there, don't touch it, if you must, back it up before deleting it.
If it's been put there as part of the auto installation then removing it could cause issues if your host tries to update it, or if it uses that folder to check if there's a WordPress install
The .qidb folder is related to Berkeley DB, but that's unrelated to WordPress, it may be related to a previous site, but I would backup that, deleting it shouldn't impact your WordPress install.
.git folder stores all your source control information, this is typically used by developers. It's a leftover by the person you hired for development of your theme/plugin.
.qidb is most likely database related but i haven't seen them associated with wordpress before.
As for functioning of your wordpress site, these folders don't affect it & are safe to delete. Nor do they hurt anyone if present. So it's totally up to you