A signature scheme is three algorithms: key generation, Sign(sk, m) and Verify(pk, m, σ). The standard security goal is EUF-CMA: after seeing signatures on messages of their choice, an attacker still cannot produce a valid signature on any new message. The stronger SUF-CMA also forbids producing a second signature on an already signed message, which ECDSA does not provide (see malleability).
A signature does not provide confidentiality, freshness (a valid signed message can be replayed unless it carries a nonce, timestamp or audience), or identity: it binds a message to a key, and something else (a certificate, a JWKS endpoint, known_hosts, a blockchain address) must bind the key to a person or service.
Sizes range from 64 bytes (Ed25519, raw P-256 ECDSA, BIP-340) through 256–512 bytes (RSA) to kilobytes for post-quantum schemes: 2,420–4,627 bytes for ML-DSA and 7,856–49,856 for SLH-DSA. The same signature is wrapped differently by each format: raw bytes, DER, JWS, COSE_Sign1, CMS SignedData, OpenPGP signature packets, SSHSIG.
A message authentication code such as HMAC also proves integrity, but with a shared key, so every verifier could have produced it; see HMAC vs signature.