When has one sufficiently mastered an area of mathematics? This is a rather soft question regarding the mastery of various mathematical subjects, such as undergraduate subjects. 
In particular, say, when has one mastered undergraduate analysis? Is it realistic to expect some individual to be able to prove every theorem and do every exercise in Baby Rudin? What about analysis not covered in Baby Rudin? Say, should one also be able to prove compactness is equivalent to sequential compactness, and sequential compactness is equivalent to closed and boundedness in $\mathbb{R}^n$? Should one be able to prove every major statement about completeness? Continuity? Integration?
Or is it enough to be able to read and understand any proof in a particular area?
When can one feel satisfied with what they know about a particular area of basic mathematics? Can the seasoned mathematician prove these theorems by heart without much thought? If so, is this due to brute memorization, or simply mathematical maturity?
In short, what should one reasonably expect an undergraduate to know about any particular subject after completing a course in said subject? I ask specifically about undergraduate subjects, since these are often the areas expected to be mastered by the time one begins graduate school and beyond. This question applies to all areas of mathematics, graduate and undergraduate.  
Interested to hear different interpretations of the words sufficiently and mastered.
 A: The deeper we dive into the ocean of mathematics, the stronger is my conviction that we actually do not know anything. Let me give some examples: 
$1.$ Every polynomial $p(z)$ has a root in $\mathbb{C}$
$2.$ For a Hilbert space $H$, $H=W\oplus W^{\perp}$, where $W$ is a closed subspace of $H$ and $W^{\perp}$ is its orthogonal complement.
$3.$ Every subgroup of an abelian group is normal.
$4.$ Compactness is the next best thing to finiteness. 
This is just a representative list. There are so many other powerful results which, when I look at, leaves me with a sense of perplexity. Can this hold ? Is mathematics so very general ?
Further introspection gives me a conviction that all these have already existed. We have found them out late. All the deepest and the most beautiful results come from within. So my firm belief is that, we can never say that one has mastered any branch of mathematics for it is impossible. Whatever we know is just a fragment of that infinite ocean. 
This is just my view. Though there are so many answers already posted, I still felt like answering this question.
A: Richard Feynman made some interesting comments about this in chapter 14 of volume 1 of the Feynman Lectures on Physics:

In learning any subject of a technical nature where mathematics plays
a role, one is confronted with the task of understanding and storing
away in the memory a huge body of facts and ideas, held together by
certain relationships which can be “proved” or “shown” to exist
between them. It is easy to confuse the proof itself with the
relationship which it establishes. Clearly, the important thing to
learn and to remember is the relationship, not the proof. In any
particular circumstance we can either say “it can be shown that” such
and such is true, or we can show it. In almost all cases, the
particular proof that is used is concocted, first of all, in such form
that it can be written quickly and easily on the chalkboard or on
paper, and so that it will be as smooth-looking as possible.
Consequently, the proof may look deceptively simple, when in fact, the
author might have worked for hours trying different ways of
calculating the same thing until he has found the neatest way, so as
to be able to show that it can be shown in the shortest amount of
time! The thing to be remembered, when seeing a proof, is not the
proof itself, but rather that it can be shown that such and such is
true. Of course, if the proof involves some mathematical procedures or
“tricks” that one has not seen before, attention should be given not
to the trick exactly, but to the mathematical idea involved.
It is
certain that in all the demonstrations that are made in a course such
as this, not one has been remembered from the time when the author
studied freshman physics. Quite the contrary: he merely remembers that
such and such is true, and to explain how it can be shown he invents a
demonstration at the moment it is needed. Anyone who has really
learned a subject should be able to follow a similar procedure, but it
is no use remembering the proofs. That is why, in this chapter, we
shall avoid the proofs of the various statements made previously, and
merely summarize the results.

(The bold is mine.)  I think this quote is open to some interpretation / debate, but it's definitely interesting.
A: If you are confident that you can lock yourself up in a room with only paper and pencil and then reproduce the subject matter (e.g. in the form of lecture notes for students) in a reasonable amount of time. 
A: My UK undergraduate degree was assessed solely on "final examinations" at the end of 3 years (and again for the 4th master's year). So for my degree the principle was that for a particular couple of weeks one summer, it was necessary to be able to prove at the drop of a hat all the theorems on the syllabus in all topics examined, and to be able to complete any exercise similar to those in the textbooks. Other degrees are run on different principles as to what's required of you by others (as opposed to what you require of yourself).
In fact, to be strictly accurate, since I was expected to choose about half the exam questions to answer, it was possible to neglect some areas and still have mastered it sufficiently for a good honours degree. For other purposes, though, "sufficient" would be different. If you just want to complete your degree comfortably, then your needs are different from if you want to do research in a field, or if you want to teach undergraduates.
I didn't do a graduate degree, but I believe that at the time I completed my undergraduate master's degree I was reasonably well prepared for one. I could and did prove the theorems (unless I forgot to address a detail and gave a flawed or incomplete proof, which I think is inevitable when working at speed, but examiners understand that and give you nearly full marks for a nearly-complete proof marred by time constraints). I could solve more than half the problems on offer (the longer I stuck at it, the higher proportion I could solve, it's not as if I completed every problem set perfectly).
Senior faculty don't leap out at junior faculty in the corridor and demand that they instantly deliver a complete elementary proof of Stokes' Theorem, but any faculty in a relevant field would be familiar enough with all the techniques involved to describe the shape of a proof straight away and fill in the details given time and paper. Whether it's better in a given situation for a professor to produce such a proof or look one up depends on the context. And from time to time, students will demand any arbitrary details of the topic, and teaching faculty who are on top of the material can deliver it more often than not. If not then they still know where to look it up.

If so, is this due to brute memorization, or simply mathematical maturity?

Definitely maturity. Memorizing a proof line by line is almost useless except perhaps as a relatively inefficient means of passing an exam. Most undergraduate proofs contain a small number of crucial points that one memorizes (or actually I'd say "learns" -- memorize might suggest just reproducing a string of letters onto the page, and that's not the best way to recall it). Learn them alongside the statement of the theorem itself. The rest of the proof is just cleaning up, and with experience is easy enough to fill in each time. So for an easy example, you might learn an elementary proof of Lagrange's Theorem in group theory as "cosets partition the group". Once that phrase allows you to write a complete proof the theorem, there's a sense in which you've mastered that one proof. So, as a first-year undergraduate I would write down that theorem, write down the gadget that I knew would prove it (i.e. define the left cosets of the subgroup in the group), and the rest of the proof is picking off the survivors.
Anecdotally, a friend who was doing his PhD while I was an undergraduate, wrote his entire undergraduate revision notes on an A1 sheet of paper and stuck it on his wall. So even if he'd rote memorized the notes (and I'm not sure even that is true), that's 8 sides of A4 covering two years' full-time study. He always said his memory was really bad, and therefore he needed to do without memorizing anything much. Understanding the material was sufficient.
At an undergraduate level, I think if a proof requires more than 2 or 3 clever gadgets of its own, then something has gone wrong, that you can address as you're studying the material. There should be some lemma that you can learn as a theorem in itself with its own proof, and then learn how to show that the big theorem is a consequence of the lemma. The reason for this is that the theorems on an undergraduate syllabus are old and well-studied, the proofs you see have been polished, and the most valuable intermediate results in the proof have been identified and separated out. Whoever proved the theorem first might have had a very different proof, or might have had "essentially the same proof" in different terminology and via a path with no signposts, but since then civilization has arrived.
In any case I think that unless you're planning to leave after your undergraduate degree (and maybe not even then), it doesn't really make sense to worry about whether you've "mastered" undergraduate analysis. The line between undergraduate analysis and further analysis is fairly arbitrary, and it's never the goal of a professional mathematician to completely comprehend a topic up to a certain level but know basically nothing about it beyond that. So if you go on, then you've "mastered" undergraduate analysis when you have a good enough grasp of "postgraduate analysis", that all of undergraduate analysis becomes basic background information to your "real knowledge". This is where the process of re-visiting and re-learning occurs, that others describe. Except perhaps for exceptional individuals, an undergraduate won't "master" any undergraduate topic to this level. Applicants for graduate programs will be expected to be able to do undergraduate mathematics and do it well, but mastery is another matter.
It certainly doesn't follow that you can always complete every exercise in the book: I've seen extremely talented and experienced mathematicians, whose research work and teaching proves that they've "mastered" the elementary parts of a field by any sensible definition, be stumped by an undergraduate problem that they've no doubt seen and solved before, just because they happen to overlook the correct approach. On another day they'd solve it instantly.
[Come to think if it, I suspect I might have seen full Professors at Oxford University briefly stumped by problems they set themselves the previous week. No particular incident comes to mind, but it's the kind of thing that can happen in fourth year classes. Mastery is only ever as good as the day you're having...]
A: I'd like to throw some words around, as an undergraduate myself. I don't really have an answer per se, but I do have some thoughts on the question based on my experiences and understanding so far.
I think it's kind of a question you ask yourself, and answer yourself. There is not one exact standard. I expect that in mathematics, no matter how far you go, you will always be learning new things, even in the most elementary sense. For example, I consider myself, to have mastered single-variable calculus. I tutor this subject, and work with probably 30-40 students per semester online and in person, helping them solve problems, prove the theorems, explain the intuition etc. These are some of the metrics that I personally use in order to feel confident in my claim that I have mastered the subject. 
On the other hand, I cannot solve problem which can be posed using only single-variable calculus. Part of this is mathematical maturity. Part of it is a lack of sufficient ingenuity. Sometimes solutions just go over my head. It is common for single-variable calculus texts to contain problems that are in fact quite difficult. The common text by Stewart contains references to contest-level problems, of which I probably could solve very few in a timely fashion, or without help.
There are some distinctions between my ability and that of my students' that I would say are good indicators of mastery though, which many students I work with come to be able to do by the end of the semester/year.
First, I'd say is quick computing. Obviously if you really understand the material, you can plug and chug with ease.
Second, is fluency with technical points. You should know the details of definitions, and be comfortable with the actual machinery of the subject to say you really have a tight grip on it.
Third, is intuition and concept relations. For many of my students in calculus, this is actually the hardest part. They can compute, and state definitions and some of them can prove theorems without much difficulty, but they can't explain to me what's going on in the problem. Making pictures is important. Try making a web of major theorems and ideas in a topic. Just like when working through a proof, you ask yourself where the hypotheses are, what the steps are, what lemmas are needed, etc, when reflecting on your ability with a subject, you should ask yourself how the big ideas fit together. What role do the biggest theorems play, and how are they connected?
Of course, all of this is very subjective, and just my two cents. I would venture to say there aren't very many areas of mathematics I'd say I've mastered, even as I go into my senior year. Mathematics is a big place, and as forgetful as I am I lose track of definitions and theorems all the time (which makes exams, especially standardized ones, absolutely terrible), but it's not about my ability to recall the meaning of words that is going to make or break my career. It's my ability to solve the problems! Can you apply the useful theorems in the right places? Can you come up with interesting tricks to make short work of the problem? In my mind, this is just as much mastery as any of the other ideas I threw around.
I hope this sheds a little light.
A: Well my answer for this would be never. You can never say what question might creep up in front and you will have no answer to it.
For example : Look at the millennium problems in mathematics. Problems like Riemann Hypothesis, Fermat's last theorem(now solved) were unsolved for hundreds of years(though RH is still unsolved). Now if you are an expert in analysis , then one should expect you to solve RH in no time. But you can't.
If everyone had become an expert in a certain topic then there wouldn't have been any development in any subject.
Always remember imperfectness is what which leads to discoveries 
