Every simple equation we use to model a system is based on assumptions, and these assumptions often cease to be accurate after a certain amount of time. Given the intuition you may have developed from the simple versions of pendulums, bouncing balls, etc., it's natural that you'd think that they'd go on forever. Really, we have to consider what actually happens in these systems and how long our assumptions are valid.
The pendulum is easier. A perfect pendulum will swing forever. What is it that makes a pendulum non-perfect? Friction can come from the air around it and the pivot it swings on. Also, the swinging of the pendulum pulls its pivot side-to-side, transferring a little bit of energy into the system it's hanging from. Each of these effects can be characterized, but doing that requires some assumptions. Let's just worry about the friction. Kinetic friction is the frictional force between two moving surfaces. If the surfaces aren't moving any longer, the surfaces 'settle in' a bit more and don't give way so easily. If you move slowly enough, however, you can get a little bit of both. This is what makes cellos to sound, hinges to squeak, and tires to screech. Static friction will kill your pendulum.
As for the bouncing ball, what is it that makes it bounce? When the ball hits the ground, it deforms and snaps back into place, launching itself into the air. But the ball doesn't return all of the energy; some of it ripples around the ball while it's in the air. Watch this video for a great example of that. Eventually, the impact will be enough to deform the ball a little, but the 'snapping back' won't be enough to launch it into the air. Even more likely, the ball will hit at such a time that its vibrations and its motion cancel out, like when you jump on a trampoline right after someone next to you and steal their jump. Physics is all about making complex things simple enough to understand, but in the end we only want to understand them well enough that we can make them complex again.
Good question, Jossie.