Yes, .gitignore files are usually located on the root folder of the repository.
To add a new .gitignore file to an existing repository, simply drop it there, add it to the list of tracked files by the repo, and then commit the change. From there on, git will not show you the files that match a pattern described in the .gitignore file as new untracked or modified files to add to new commits.
However, it's not retroactive, so this will not delete existing files in your remote repository, you will have to do that by hand.
To add a new .gitignore file to an existing repository, simply drop it there, add it to the list of tracked files by the repo, and then commit the change. From there on, git will not show you the files that match a pattern described in the .gitignore file as new untracked or modified files to add to new commits.
However, it's not retroactive, so this will not delete existing files in your remote repository, you will have to do that by hand.