A confined space is one large enough to enter and work in, with limited means of entry or exit, and not designed for continuous occupancy — think tanks, vaults, pits, manholes, and similar. Not every confined space triggers a written program, but many do, and the line is whether the space is permit-required.
A space is permit-required if it has one or more of these: a hazardous atmosphere (or the potential for one), a material that could engulf an entrant, an internal configuration that could trap or asphyxiate, or any other recognized serious hazard. When you have permit-required confined spaces, OSHA requires a written permit-space program.
Two things worth knowing:
Construction and General Industry have separate standards. The confined-space requirements for construction work and for general-industry facilities are governed by different rules with different specifics. Which applies depends on your branch.
The program governs the whole entry system — permits, atmospheric testing, entry supervisors and attendants, and rescue procedures.