Mazur and contractible manifolds A Mazur manifold is a contractible, compact, smooth $4$-manifold with boundary a homology $3$-sphere.
It is built from a single $0$-handle, a single $1$-handle and single $2$-handle. It is equivalent that the $4$-manifold must be of the form $\displaystyle S^{1}\times D^{3}$ union a $2$-handle. (Handles are all $4$-dimensional.) The following picture is from Akbulut and Durusoy's paper:

Here, $W$ is a Mazur manifold with the boundary Brieskorn sphere $\Sigma(2,5,7)$. The dark blacked dotted circle shows the $1$-handle which can be drawn as $0$-framing unknot.
Q1. Are we free how we attach $2$-handles to $S^1 \times D^3$?
Q2. For example, the following picture describes a Mazur manifold?

There are contractible $4$-manifolds built with a $0$-handle, two $1$-handles, and two $2$-handles. They are the examples of Stern.
Q3. Do we know the classification of contractible $4$-manifolds in terms of their handle numbers?
 A: About terminology: wikipedia defines a Mazur manifold as a contractible compact smooth 4-manifold that is not diffeomorphic to the 4-ball. (It follows from this definition that the boundary of such a manifold is automatically an integral homology sphere.) It also says that frequently the definition is restricted to manifolds constructed with only one handles of each index 0, 1, and 2. I will stick to this latter definition, for consistency with your question(s).
What Anubhav refers to in his comment is a further restriction, but I wouldn't put it in the definition of a Mazur manifold (but rather speak of a Mazur cork if you have such an involution).
Now that we all agree on the objects, let's get to the questions.
Q1. No, we're not free. Suppose you have a presentation of a 4-manifold $W$ with one 1-handle and one 2-handle. The 1-handle gives you a generator in the presentation of the fundamental group of the 4-manifold, and the attaching circle of the 2-handle gives you a relation (which is the only relation, since you only have one 2-handle). If you want the fundamental group of $W$ to be trivial, you better have that the relation kills the generator, which translates to the attaching circle generating the homology of $S^1\times S^2$. Diagrammatically, you're asking for the linking number between the dotted circle and the framed knot to be ±1.
This is almost the only restriction, except that you need to check that the 4-manifold is not the 4-ball, but it follows from the property R that there is only one such knot.
This is actually a good segue for question 2.
Q2. No, these are not Mazur manifolds. Even interpreting the 0-framed 2-handle as a 1-handle (otherwise you don't even have the right homology groups), this is just $B^4$: the 2-handle geometrically cancels the 1-handle.
Q3. I highly doubt it, and I don't think the question can have a "nice answer". These questions about 4-manifolds are usually incredibly hard.
