First of all, the design is analyzed to ensure that no normal conditions will cause the structure to fail. In reality, any structure can fail, so any kind of structural failure is possible. Of course, we like our airplanes to not fall apart in flight, so many things are done to prevent that from happening.
When considering failure of structure, two main things are considered: what is the consequence of failure, and how easy is it to detect?
When the consequence of failure is high, of course the part is designed as much as possible to not fail. Parts are designed such that any damage will be contained and not become a widespread failure. Another approach is fail safe structure, such that if part of it fails, other parts will still carry the load until an inspection will find it.
Aircraft are inspected regularly, in detail ranging from a regular walkaround by the crew before/after a flight, all the way up to a D check where the whole airplane is basically taken apart, inspected, and put back together. These inspections are designed to find structural issues and fix them.
Some failures are obvious, such as large parts departing the airplane. As Carlo mentioned, there may be many clues if this happens. A failure of the fuselage pressure vessel will result in depressurization. Structural failure may cause other systems to be damaged, such as hydraulics, control surfaces, or electrical systems, which will trigger warnings in the cockpit. In these cases, the parts are designed to allow the plane to safely land, after which it is assumed the damage will be repaired. Of course, this doesn't always happen, but structure is designed to handle much more load than most flights ever experience.
Other failures may not be apparent at all. In these cases, special inspections may be required to check for issues, or the failure must not compromise the structure until a regular inspection will find the issue.