My two cents: during all my university studies and after that, the best method I've ever had to study and memorize is to teach an imaginary class what I'm trying to grasp...over and over until I could actually teach that piece of stuff to a real class.
This imaginary class poses tough questions, asks for examples and counter-examples, analyzes each tiny aspect of what's been taught, and you as the teacher must be able to address and give satisfactory answers and insights.
Big secret: keep by your side several books on the subject (tablets now are incredibly handy for this), which you'll consult constantly until you're able to give an AAA lecture to your imaginary class on the subject being taught.
Last one big secret: be tough on yourself and demand from yourself excellency while doing this "teaching".
I tend to remember the main point of many theorems, but I often don't remember the details of the statements. When you actually want to use a theorem, you have to look it up.
For example, I know that there's a theorem that the set of homotopy classes of maps $X\to S^1$ is in one-to-one correspondence with the elements of $H^1(X)$, but I have no idea off the top of my head what hypotheses on $X$ are necessary to make this theorem true. For all I know, this may hold for arbitrary topological spaces, there may be some connectedness requirement, or it may even require $X$ to have the homotopy type of a CW complex. What I do know is that this theorem is somewhere in Hatcher's Algebraic Topology, and I would be able to look it up in five minutes or so. (By the way, this is one reason that you should keep around copies of books that you are familiar with. I am much faster at looking things up in Hatcher than I would be with another algebraic topology book.)
For other theorems, it's possible for me to reconstruct the details without looking it up. For example, the Poisson integral formula expresses a holomorphic function inside a disk in terms of the value of the function on the boundary circle. I do not use this theorem often enough to remember it off the top of my head, but I can re-derive it whenever I want using the following procedure:
(1) I know that the value of a holomorphic function in the center of the disk is equal to the average value of the function on the boundary circle. (The same is true of harmonic functions---indeed, the definition of a harmonic function is basically just that this is true for infinitesimal disks.)
(2) I also know that I can use Möbius transformations to map the center to any other point inside the disk in a way that maps the boundary to itself. I'm good at working out the formulas for Möbius transformations, so I can combine this with (1) to find the value of the function at any other point inside the disk.
There are certainly many other ways of deriving the Poisson formula -- you should use whichever one works best for you.
Finally, some theorems are hard to forget. For example, Lagrange's Theorem states that if $G$ is a finite group and $H\leq G$, then the order of $H$ must divide the order of $G$. This theorem is so obvious (picture the cosets), that I've always found it strange that it deserves a name, and I can't imagine ever forgetting that this theorem is true. (That being said, I do sometimes forget the name of this theorem. In particular, it's sometimes hard for me to remember which theorem is Lagrange's Theorem and which theorem is Cauchy's Theorem.)
Best Answer
I think it is really close to know the theorems and their proofs in the following sense.
When doing mathematics (whether it is an exercise sheet or research) you often want to prove things by reducing it to things you know. So it is helpful if not necessary to know the theorems of the subject you are working in and have an idea how and why they work. By this I don’t mean remembering proofs in full detail, but rather a sketch like extend a basis of the subspace to the whole space. Some theorems are crucial for a theory to work out (eg. existence of bases, extending bases and being able to define linear functions on a basis) and not knowing them is equivalent to not knowing the subject at all. But even if you cannot apply a (maybe less crucial) theorem per se, its proof may use methods/tricks applicable to your problem.
In fact it is useful to have this sort of knowledge of every bit of mathematics you learn. Great mathematics often comes by connecting seemingly different areas of mathematics. I mean what on earth has something rigid algebraic like group theory to do with analytic things like measure theory and Fourier-transformations? Some mathematicians knew enough about both topics to notice similarities of the objects/concepts/proofs and made a connection. These sort of connections allow new ideas to flow from one subject to the other, which is a really great thing.
There is a last kind of mathematical knowledge that is very common in research. It can become impossible to know each and every paper in and around your research topic, as new ones appear on a daily basis. But you can have an overview over the progress in the area in that by reading abstracts and attending conferences you are up to date in what progress and what connections were made. If you happen to need some statement you might recall that you read/heard something along the lines, locate and study it in more detail.
TLDR: As a student know the theorems and have a sketch in mind of how to prove them. You will need the ideas and methods later, sometimes even from different subjects combined. In research it is often more important to know that something is true than how it was proved.