Formally speaking, sets are atomic in mathematics.1 They have no definition. They are just "basic objects". You can try and define a set as an object in the universe of a theory designated as "set theory". This reduces the definition as to what we call "set theory", and this is not really a mathematical definition anymore.

In naive settings, we say that sets are mathematical objects which are collections of mathematical objects, and that there is no meaning to order and repetition of the objects in the collection.

And when we move back to formal settings, like $\sf ZF,NBG,ETCS,NF$2 or other set theories, we try to formalize the properties we expect from sets to have. These may include, for example, the existence of power sets, or various comprehension schemata. But none of them is particularly canonical to the meaning of "set".

These are just ways to formalize, using a binary relation (or whatever you have in the language), the idea of membership, or inclusion, or whatever you think should be the atomic relation defining sets. But as for a right definition? In this aspect "set" is as Platonic as "chair" or "number" or "life".


Footnotes:

  1. This assumes that you take a foundational approach based on set theory. There are other approaches to mathematics, e.g. type theory, in which the notion of "type" is primitive, and sets are just a certain type of objects.

    Sufficiently strong set theories can interpret these foundations as well, reducing them to sets if you choose to, or not if you choose not to.

  2. These are Zermelo-Fraenkel, von Neumann-Goedel-Bernays, Elementary Theory of Category of Sets, and New Foundations. These are not the only set theories, of course. And the point of the answer is that these just offer formal frameworks for the notion of "set" as a primitive object (in one way or another).


Sets have members, and two sets are the same set if, and only if, they have the same members.

That is not quite enough to characterize what sets are.

For example, is the set of all sets that are not members of themselves a member of itself? If so, you get a contradition, and if not, you get a contradiction. The "class" of all sets is "too big to be a set", and that simply means you cannot apply to it all the operations you can with sets. The same thing forbids the class of all groups to be a set of all groups: if it were a set, then the set of permutations of its members would be a group, and would therefore be a member of the set of all groups, and that leads to problems like those of the set of all sets that are not members of themselves. Likewise, the class of all vector spaces is not a set, etc. These "proper classes" differ from "sets" only it that they are not members of any other classes.

E. Kamke's Theory of Sets and Paul Halmos' Naive Set Theory are fairly gentle, if moderately onerous, introductions to "naive" set theory. In "naive" set theory, sets are collections of things. In "axiomatic" set theory, sets are whatever satifies the axioms. Halmos inadvertenly coined the term "naive set theory" by naming his book that, when he mistakenly thought the term was already in standard use.