Git is a free and open source distributed version control system that can handle small to very large projects. It’s mostly used to keep the history of your source code.
Github is a company that provides an online git hosting service, used by some projects to keep their source code.
There are several companies like gitlab, bitbucket that offer github like service. They all use git to manage a user’s project source code internally.