Just to expand on the answer by @rinzwind:
How packages and repositories work (over simplified)
Most normal packages are available in both executable and source repositories.
These hold the executable and source code portions (respectively) of the components of the package (and of the other packages in the repositories).
If you install just the executable version of the package, it will have everything it needs to run successfully. And, if you install it using a package manager such as apt, all the needed dependencies will also be installed. These will be marked as "automatic"ly installed (see below.)
When you uninstall an executable package, whatever the package installed will be removed - except for configuration files that you might want to keep for a number of reasons. Purging a package (while deleting it) gets rid of the configuration files too.
Once a package has been removed, any additional packages (dependencies) that were installed "automatically" just to make it work are no longer needed (unless something else is using them). The package manager analyses this and offers to remove them the next time it runs.
Note that in the above description, there is no mention of the source files/packages/repositories.
Source files (and the packages/repositories they come from) are generally only needed in two situations.
1) You need to manually build some or all of the components from scratch using tools like compilers and make
files to get a version that matches your system exactly or that you can modify for your individual needs.
2) You need to manually build another program (in a similar manner) which needs things like the header files from another program/package so it can interface with programs from that package.
These are things which intermediate and advanced users occasionally do - e.g. if they want to install a program from a tarball that's not already in a package.
For almost all programs/packages/repositories, you should not need the source code/packages/repositories at all in the first place unless you're doing something special or want to read the source code to educate yourself or to figure out the fine points of how something works.
So, if any source code repositories/packages are installed on your system - especially ones that were added by something you did, they can usually be safely removed.
However, with most complex systems like Linux, you should only delete things you know got added by something you did. Having a few extra source repositories defined on your system isn't going to hurt anything.