The short answer: at least six
Most guides suggest keeping at least six corydoras together. Some sources list three as the minimum, but six is the figure given most often for standard-size species, and it tends to produce calmer, more natural behavior. Keeping a cory alone or in a pair is generally not recommended.
Why corydoras need a group
Corydoras are social fish that feed, rest, and move around together. A lone cory often hides, stays in one spot, and seems stressed. In a group, they tend to be more confident and easier to see. Watching a group sift the floor together is one of the main reasons people keep them.
Tank size for a group
Many guides set about 20 gallons as a minimum for a small group of standard-size corydoras. A bigger group needs more floor space, and more fish add to the load on the filter and the water. Plan the tank around the group you want rather than the number that happens to fit.
If you plan to add other species, check how many fish in 20 gallon tank works before you commit. The corydoras take up part of that count.
Pygmy corydoras are different
Pygmy corydoras are much smaller than the standard species, and they are often kept in larger groups. Many guides suggest a group of eight to ten in a tank of about 10 gallons or more. A bigger tank gives a larger group more room to spread out.
Mixing species
Keeping one species in a group is the simplest approach. Different corydoras can share a tank in some setups, but species can differ in temperature and water needs, so check each one before you mix them. A single species also makes it easier to tell whether the group is doing well.
Buy the group at once
If you can, buy the whole group in one trip rather than adding one fish at a time. A group that arrives together can settle together, while a single fish added later may be stressed by the others. Many keepers learn how to drip acclimate fish before a group goes in, which slows the change in water conditions.
The same logic applies to other fish. Many keepers ask how many fish to add at once to new tank, and for corydoras the answer is the whole group together, once the tank has cycled.
Signs a group is working
Healthy corydoras are active on the floor, eat when food is offered, and move as a group. A cory that hides most of the time or stops eating may be stressed. Check the water and the group size first.