How do I chose a suitable boundary in Stokes’ Theorem?

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"?