Forgive me if this explanation is too elementary, but you seem to be having trouble with what the notation means. First of all, there is an unwritten assumption here that 1 \leq m \leq n, so all that follows will suppose that.
Think of the symbol \sum_{k=1}^n k^2 as an instruction to add up the values in n labeled boxes. The boxes are labeled 1 through n, and each box contains the value which is the square of its label: if the box is labeled k, the value in it is k^2.
Now look at the right-hand side. \sum_{k=1}^n k^2 - \sum_{k=1}^m k^2 means: take the sum of the values in n red boxes labeled 1 through n, where the value in red box k is k^2, and subtract the sum of the values in m blue boxes labeled 1 through m, where the value in blue box k is k^2.
At this point we notice that the rule for putting values in the red boxes and the rule for putting values in the blue boxes are the same, so we can cancel a red box by subtracting off the corresponding blue box. We are left only with the red boxes that didn't have a corresponding blue box, that is, those with labels that are not between 1 and m. What are the remaining labels? The ones between m+1 and n. Thus the result of subtracting is \sum_{k=m+1}^n k^2.
Incidentally, this value is not n^2 - m^2. You can compute it without too much trouble (proving the formula for the sum of the first n squares is a standard exercise in mathematical induction). But you should be able to see immediately that n^2 - m^2 is wrong, because you are adding up a bunch of positive terms the largest of which is n^2, so you shouldn't be able to get something smaller than n^2.
(Why are some boxes red and some boxes blue? To make the point that the terms of different \sum signs need not have anything to do with each other. There's no clever cancellation trick you can do with \sum_{k=1}^n k^2 - \sum_{k=1}^m \log k.)