Whether there is a distinction, and what the distinction consists in, is a hotly debated topic. Here are a few things that are typically claimed to be essential to logic:
- Universal applicability: the laws of logic apply to every subject matter. This would mean that, e.g., different theories of arithmetic have the same underlying logic (usually something like classical first-order logic).
- Ontological neutrality: the thought here is that there are no distinctively logical objects, and nothing need exist for logic to be true. Arithmetic assumes the existence of the natural numbers. Set theory assumes the existence of sets. Logic is supposed to be free of any similar existential assumptions.
- Epistemic priority: the fundamental truths of logic are in some sense more immune to doubt and more a priori certain than any other subject matter. There are two thoughts here. The first is that knowledge of everything else, including math, requires knowledge of logic. The second is that there is less or no room for doubt when it comes to logic.
Now, each of those claims are debatable. “Universal applicability” seems hard to come by unless you assume a very weak logic, weaker than people typically assume. Classical logic won’t work for intuitionists, and intuitionistic logic won’t capture distinctions central to paraconsistent logics.
Ontological neutrality is similarly debatable. First-order logic is plausibly neutral, but it is relatively weak expressively. For example, it cannot capture the distinction between “finite” and “infinite” and so will be unable to characterize a lot of theories definitely (i.e., you’ll have non-standard models).
Finally, epistemic priority is also up for debate. Depending on what gets included in “logic”, it’s plausible that simple arithmetic and geometric truths are on surer footing or at least more “obvious” than much of logic.
Now, for the early logicists, logic was pretty strong. Russell and Whitehead’s type theory was strong enough to interpret arithmetic — Gödel’s proof of incompleteness is couched in that system — and at least a weak set theory. The problem for them was that Gödel’s results seemed to show that logic couldn’t be the firm foundation they had hoped for, at least not for any mathematics of interest.
The “neo-logicists” make a more modest claim that logic (a weak second-order logic), combined with some conceptual truths about mathematics (like “Hume’s Principle” for the natural numbers), provides a foundation for mathematics. Here the objections will typically be to either the comprehensiveness of the program — it can’t capture all mathematics — or to the logical status of their “logic” (that it’s just “set theory in sheep’s clothing”).
Further reading:
A good survey book on the philosophy of mathematics is Stewart Shapiro's Thinking About Mathematics. Chapter 5 covers logicism and touches on all of these topics, but all of part III (chs. 5 -- 7) is relevant. A freely available discussion of logicism can be found at the SEP. The classic text for neo-logicism (also called "neo-Fregeanism"), championed primarily by Crispin Wright and Bob Hale, is Wright's Frege's Conception of Numbers as Objects. Wright and Hale have a collection of essays on neo-logicism titled The Reason's Proper Study. The SEP entry on "Logic and Ontology" and the entry on "Logical Constants" are also relevant.
More advanced discussion of each of the topics:
- Universal applicability: this traces back to Kant and especially Frege, who separated (1) and (2) by allowing "concepts" to be part of logic's ontology. Quoting from the SEP entry on "Logical Constants":
…the basic propositions on which arithmetic is based cannot apply merely to a limited area whose peculiarities they express in the way in which the axioms of geometry express the peculiarities of what is spatial; rather, these basic propositions must extend to everything that can be thought. And surely we are justified in ascribing such extremely general propositions to logic. (1885, 95, in Frege 1984; for further discussion, see MacFarlane 2002)
The referenced MacFarlane article is “Frege, Kant, and the Logic in Logicism”. Also see Aldo Antonelli and Robert May's "Frege's New Science" (2000).
- Ontological neutrality: George Boolos has a good discussion of this in his "On Second-Order Logic" (1975; reprinted in his Logic, Logic, Logic, citations from the reprint). He connects it to (1) under the title of "topic neutrality":
[T]he idea is that the special sciences, such as astronomy, field theory or set theory, have their own special subject matters, such as heavenly bodies, fields, or sets, but that logic is not about any sort of thing in particular, and, therefore, it is no more in the province of logic to make assertions to the effect that sets of such-and-such sorts exist than to make claims about the existence of various types of planets. (p. 44)
- Epistemic priority: a classic (critical) discussion of this topic is Quine's The Web of Belief. In it he discusses the idea that the truths of logic are somehow more "immune to revision" than other truths. While he is sympathetic to the idea that they are more immune to revision -- more "central to our web of belief" -- he rejects the classic view that they are wholly immune to revision. Chapter 4 on "Self-Evidence" is the most relevant here.