I wouldn't change a word in Student T's excellent and efficient answer, save that to note that you are only obligated to publish (and, moreover, freely-relicense) your changes if you give or sell copies of your modified software to other people. That is, you incur licence obligations not when you modify the original code, but when you convey copies to others.
In case you want to know why you will then be obligated to publish your changes along with the original code, it's because you will have conveyed modified copies of the original GPLv3 work. GPLv3 s0 says
To “modify” a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a “modified version” of the earlier work or a work “based on” the earlier work.
and that given, GPLv3 s5 says that when Conveying Modified Source Versions,
You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged.