What exactly is a “security parameter”?

I often encounter the term “security parameter” when I read crypto related stuff. My basic understanding is that it just denotes some bit-length however, I'm not so sure.

For example, when it says

… output strings of length 2K where K is the security parameter

how should I understand that ?

The security parameter is usually expressed in unary representation (for example, a security parameter of $$n$$ is expressed as a string of $$n$$ 1s) so that the time complexity of the cryptographic algorithm is polynomial in the size of the input. For example, in the RSA cryptosystem, the security parameter $$k$$ denotes the length in bits of the modulus $$n$$; the positive integer $$n$$ must therefore be a number in the set $${0, …, 2^k - 1}$$.