I have a question regarding the boundries in stoke's theorem. Stokes theorem states:
$$\oint_C \vec{F}\cdot d\vec{r}={\int\int}_S (\nabla \times \vec{F}) d\vec{S}$$
As far as I understand it relates the flux of the curl of a vector field $\vec{F}$ through a surface $S$ to a closed line integral along the boundry curve of $S$ called $C$. What I don't understand is: How do you choose a suitable path $C$ to integrate along? For example, consider the following surface:
Which path encloses the surface? Would it be the bottom "circle" or would it be some other curve?
Or suppose we have a cylinder with no top or bottom:

Does it matter if I integrate along the top or the bottom "circle"?

The curve needs to be the entire boundary. If there is more than one component to that boundary, you need to integrate over all of the pieces, each one suitably oriented. (In the case of the cylinder, oriented with its normal pointing outward, you orient the bottom circle counterclockwise and the top circle clockwise.)