The surface can be any orientable surface whose boundary is the chosen loop.
For reference, Ampère's law with Maxwell's correction in integral form:
$$\oint_{\partial S} \mathbf{B} \cdot d\mathbf{l} = \mu_0 I_{enc} + \mu_0 \epsilon_0 \iint_S \frac{\partial\mathbf{E}}{\partial t} \cdot d\mathbf{a}$$
The value of the right-hand side is independent of the surface chosen. To see this, suppose two surfaces, $S_1$ and $S_2$, both have the same boundary $\partial S$. Then take the difference in the right-hand side evaluated on the two surfaces. You will end up with a term of the form $\mu_0 I + \mu_0 \epsilon_0 \iint \partial\mathbf{E}/\partial t \cdot d\mathbf{a}$ evaluated on a closed surface. Using Gauss's law, the second term can be converted into $\mu_0 \partial Q/\partial t$ where $Q$ is the charge enclosed. But $\mu_0(I + \partial Q/\partial t) = 0$ by charge conservation.
Note that this depends crucially on the displacement current term. If it is omitted, then the right-hand side may differ for two choices of the surface, if charge is building up in the volume between them. In many textbooks, this discrepancy is used to motivate the presence of the displacement current term.
First of all I would like to give you an answer to what the magnetic field will be for an infinitely long straight current carrying wire.
Magnetic field due to straight current carrying wire (infinite length)
Consider a wire of infinite length, carrying current $I$. The magnetic field strength due to that wire at a some point $P$ situated at distance $r$ from the wire can be calculated as follows:
From Ampere's Law,
$$\oint \boldsymbol B\cdot \mathrm d\boldsymbol l = \mu_0 I,$$
Where $\oint \boldsymbol B\cdot \mathrm d\boldsymbol l$ = Line integral of magnetic field along circular path. As angle between the vector $B$ and $\mathrm d\boldsymbol l$ is $0^0$,
$$\oint \boldsymbol B\cdot \mathrm d\boldsymbol l = \oint \boldsymbol B\cdot \mathrm d\boldsymbol l \cos0 = \boldsymbol B\oint \mathrm d\boldsymbol l$$
But $\oint \mathrm d\boldsymbol l = \boldsymbol {2\pi r}$ (Circumfrence of the circular path of radius $\boldsymbol r$)
$$\oint \boldsymbol B\cdot \mathrm d\boldsymbol l=\boldsymbol B \times \boldsymbol {2\pi r}$$
But $\boldsymbol B \times \boldsymbol {2\pi r}=\boldsymbol \mu_0$ thus,
$$\boldsymbol B = \frac{\mu_0 I}{2\pi r}= \frac {\mu_0}{4\pi} \frac {2I}{r}$$
Explanation (Why can't you use Ampere's law for a finite length wire):
What you have to understand in the above case is that the assumption of an infinite wire means that the Magnetic field will have the same magnitude (at distance $\boldsymbol r$ from the wire) at any point parallel to the axis of the wire.
In case of a finite wire, the Magnetic field will vary in strength depending on how far from the ends of the wire the point in space is, and its direction is no longer exactly parallel with the circle drawn around the wire.
In such circumstances it is more ideal to use the Biot-Savart law instead of Ampere's law
Best Answer
We use the idealized case of an infinitely long current to be able to justify (by symmetry) that the strength of the field will only depend on the radial coordinate $r$, so that it can be taken out of the integral, since we are only integrating over the angle which parametrizes a circle around the wire:
$$ \oint B\cdot d\ell = B \int_0^{2\pi}r\ d\theta = 2\pi r B = \mu_0 I\implies B=\frac{\mu_0I}{2\pi r}$$
If the wire is not infinitely long, you can move towards the end of it, where it is obvious that the $B$-field should not just depend on the radial coordinate, so our simple calculation fails. In practice, one can very often use this ideal case as a good approximation for the field close to the wire - so long as the distance from the wire is much smaller than the length of the wire the effect is pretty much that of an infinite wire.