In particular, what does it mean when a line (e.g, emission line in stellar wind) is optically thick or thin. I know what an optically think/thick medium is, but how does this concept compare to optically thick/thin line.
I know what an optically think/thick medium is...
Okay so this isn't much more complicated. A medium or material can be optically dense or opaque at one wavelength, but fairly transparent at a different wavelength.
If you look at the dark plastic window on a remote control for a TV or other appliance, you can't see through it. It's optically dense at visible wavelengths, but it's mostly transparent between say 850 and 1050 nm wavelengths, so that the infrared LED light can still shine through it and communicate with the receiver.
So at each wavelength the medium can have a different opacity. For this window, it's roughly a step function in the visible and near-IR, high opacity in the visible and low opacity in the IR.
You can extend the same idea to one spectral line or many of them. Perhaps a medium can absorb at or near the center of the spectral line where there is a strong transition, but more weakly as you move away from the center wavelength, and then perhaps almost not at all farther away.
I the video testing Hoya UV & IR Cut Filter at first you can see the purple spot; that's actually IR light that can still be seen by the video camera. The dark plastic has high opacity in the visible and low in the IR. Then they introduce an IR filter that is the opposite, high opacity in the IR and low in the visible (you can see right through it) but it still blocks the IR.
See also the answers to What is the purpose of the IR-diode Cover on Remote Controls?
The optical depth $\tau$ is defined as a wavelength dependent quantity, right?
We have in general $$\tau(\lambda,z) = \int_0^z dz' \rho(z') \kappa(z', \lambda).$$ The energy transition of your line will correspond to some wavelength $\lambda_t$, then to decide if a line is optically thin or thick, you simply look at the quantiy $\tau(\lambda_t,z)$. This quantity will be large at the line center and smaller at the line wings, because the natural line profile is proportional to $\kappa(\lambda)$ for a single line.