A QR code turns a piece of text (most often a URL) into a square pattern any phone camera can read. Generating one takes seconds, but a few choices, like how much text you put in and which error correction level you pick, decide whether it scans reliably once printed.
What a QR code actually stores
A QR code holds the text itself, not a pointer to a server. A code for a URL keeps working as long as that URL does, without any connection back to the site that generated it; scanning it offline still reads the text, though opening a link needs a connection.
Capacity depends on the kind of data: up to about 4,296 alphanumeric characters at the lowest error correction, and less for arbitrary text. The more you encode, the denser the pattern and the harder it is to scan from a distance or at a small size.
Choosing an error correction level
QR codes add redundancy so they still scan when part of the pattern is dirty, damaged or covered. The four levels recover roughly 7% (L), 15% (M), 25% (Q) and 30% (H) of the code.
M is a sensible default. Choose H when you plan to place a logo over the middle or the code will be printed somewhere it can get scuffed, and L when the content is long and you need the simplest possible pattern.
Tips for a code that scans
Keep URLs short, leave a quiet margin of blank space around the code, print it with strong contrast (dark on light), and test it with more than one phone before printing many copies.
Trying it yourself
The QR Code Generator on this site renders the code in your browser as you type, lets you pick the error correction level, and downloads it as a PNG. Nothing you type is uploaded. Use the URL Encoder first if your link contains spaces or special characters.