Depending on where you got it from, it's either malware or just useless. You should uninstall it either way.
Although the official version of MacKeeper isn't directly harmful usually and doesn't qualify as typical malware, it doesn't do any good–and in some cases, may actually remove files it shouldn't. There are much better apps for "cleaning" your computer, like CleanMyMac 3, MalwareBytes Anti-Malware, AppCleaner, etc. They've also been the subject of data leaks and class-action lawsuits. Many versions are not clean copies, with other viruses of various sorts loaded on disguised as part of MacKeeper.
So how to get rid of it? MacWorld has a pretty good guide, but I'll skip some of it in favor of just downloading MalwareBytes Anti-Malware and letting it do it's job in case some other stuff got installed as well. Let it run, and once it's done, if there are any remaining traces, quit any relevant process and move them to the trash and empty said trash.
Overall, it's a good idea not to click on advertisements if you don't understand entirely what they're advertising. uBlock Origin is a good content blocker that does a good job blocking ads if you'd like to refrain from accidentally reinstalling it in the future. Still, nothing is guaranteed: make sure you know what you're clicking on and giving access to before you do.