You have discovered that there is, in fact, a joint between your ribs and your sternum. While we generally tend to think of joints simply as those body parts that move (such as an elbow or knee), where 2 bones come together, there is some kind of joint (even in your skull, although those obviously don't move at all, usually). The joint at your sternum and your ribs is a cartilaginous structure that you might remember if you've ever seen a bony model of the human anatomy. The bone runs right into the sternum, but at the tip there is a variable amount of cartilage (much softer than bone, but still firm) that connects the two.
In general, the ribs and the sternum don't move too much, but it does occur, and can sometimes be audible. In some people, the joint is a source of sharp chest pain that can be reproduced (you can make it happen) by pressing firmly with one finger on the spot. That pain, when it becomes bothersome, is called costochondritis by doctors
(costo is from costals, which means ribs, chondral tissue is cartilage, and the suffix -itis means inflammation). Over the counter remedies are often helpful for treating the discomfort. If the problem persists or becomes an issue in any other way, please see your physician to discuss it. If you have no other concerns than the "cracking," you might consider bringing it up next time you have your annual physical
or preventive health checkup.