What keeps solids solid

What you're asking about is the range of a force, and it's actually a very interesting concept.

The fundamental phenomena and their force laws

Physics has with some confidence divided the world into approximately four fundamental phenomena. You're most familiar with them as: atomic nuclei normally stick together, that nuclei sometimes fall apart (radioactivity), that like electric charges repel and unlike charges attract (electromagnetism), and that things fall down (gravity). The force laws that govern these phenomena have different scalings with distance: the first force is technically approximately constant across any distance, the second decays exponentially with distance, and the last two follow inverse square laws.

But those basic rules are only part of the story. The only one that this gives a good overall picture of is gravity, and that's because there are no negative masses to interact with the positive masses and mess with our description. It's kind of funny, gravity is kind of the asthmatic kid sister of these four fundamental phenomena, she is many, many times over the weakest: but over long distance scales with big complicated systems, she always wins. Her plans and machinations extend across the cosmological scale, way beyond anything that her other siblings can do.

Balancing charges, e.g. in the strong force

With the two other "strong" ones, the strong nuclear force holding nuclei together and electromagnetism, it's possible to have "charge balance" of different kinds. Electromagnetism of course has positive and negative charges; but let me tell you first about this infinite-range strong force, which has what we call "color charge": there are three charges (conventionally called "red," "green," and "blue," but the names are just names and don't correspond to any sort of real color in any real sense) and their anti-charges ("antired", "antigreen", "antiblue"). A given quark has one of these 6 charges, and the force particle ("gluon") that pulls them together has two such colors. So a red quark might "turn into" a green quark by "firing off" a red-antigreen "gluon" which can then be "absorbed" by a green quark, turning it into a red quark: the net effect of all of these interactions in quantum mechanics is this infinite-range "strong force" between these quarks.

Why don't you feel this super-strong force? In fact this force is so strong that it interacts with the quantum vacuum, a seething mass of particles being created for tiny fractions of seconds and then immediately disappearing. If you separate these two quarks by too far, there is more potential energy in their separation than it takes to create new quarks: so some quark-antiquark pair that the quantum vacuum creates for a tiny fraction of time, will find itself being torn apart into real existence by this overwhelming energy.

In fact the only particles that you finally see at scales the size of an atomic nucleus or larger are all "color-balanced"--either three quarks, one of each color ("baryons"), or two quarks: one of a color and one of its anti-color ("mesons"). But these mesons then create a new sort of force between two baryons: it's still kind of the same "strong nuclear force," but now it lives between two color-charge-neutral particles and it diminishes exponentially with distance. And that's how nuclei are held together.

Charge screening in the electromagnetic force

So the electromagnetic force has a similar way it falls apart, but it's much easier to understand because there's just one dimension of charge, positive vs. negative: that's it.

An isolated proton and an isolated electron will feel a very strong attractive force; two isolated protons will feel a very strong repulsive force. But if you let that proton and electron sit in a box together then that electron is likely to enter an "orbital" around the proton, where due to the laws of quantum mechanics the electron can't be clearly said to be at one place or another, but it's kind of one particle in a "cloud" of positions around the nucleus. Now that proton has become a "Hydrogen atom."

What has happened to the range of its force? It has dropped significantly! Over long distance scales, a proton will be pushed away by the proton in the hydrogen atom, exactly as much as it is attracted by the electron cloud of the hydrogen atom. It's only when you get very close that you notice the difference in the $1/r^2$ effects of the cloud versus the particle in the middle. This sort of change in effective electric charge due to configurations changing is called "screening" the charge, it makes its force appear weaker, as if seen through a screen.

Bonding

When many atoms come together, a lot depends on how the electrons rearrange themselves around the nuclei. The nuclei have almost all of the mass, so they don't move nearly so easily as the electrons do. Most of the electrons keep orbiting their respective nuclei in their various orbitals. Usually the electrons furthest out reconfigure in some way.

One nasty possibility is that an atom just steals the electron from another: this happens for example with the Chlorine atoms and Sodium atoms in table salt. Afterwards the two form ions which attract together like particles again. More common is if an electron assumes a "shared orbital" that bridges the two atoms, holding them together: this is called a "covalent bond" and the atoms inside form a "molecule". Inside a metal, the nuclei arrange together in what's locally a very periodic lattice of nuclei, and some electrons start to be delocalized, shared across many many atoms rather than just holding pairs of them together: this is called a "metallic bond".

And sometimes things just don't bond, they stick to each other through weak interatomic forces ("van der Waals" forces and "hydrogen bonds"), but it's really just this screened electric charge that's holding them together.

Anyway, the point is that this makes it hard to push these clouds through each other and creates minimum distances that they want to stay apart, because the nuclei and electron clouds start to repel really aggressively at any closer distance.

How these bonds make up you

So we've covered that atoms "take up" a (fuzzy!) ball of space because of their electron clouds, and that sometimes those balls are sort of "merged" via covalent bonding into these bigger things called molecules, where some electrons are really occupying a cloud around both atoms. This is enough to tell the difference between "these are two molecules pressed up next to each other" and "this is one molecule." I also need to tell you that the covalent bond is a lot stronger than the "stickyness" of molecules pressed up next to each other, so molecules at our scales pretty much always stay together -- there are things like UV light which can rip them apart (which, when it damages the DNA molecule, is why you can get cancer from too much UV light!) but for just pressing against your desk, molecules might be transferred but they are not leaving each other.

Beyond that: different molecules stick to each other stronger or less strongly. A good example, and very relevant to our discussion, is water. Now you know that water is a little asymmetric, looking kind of like a "Mickey Mouse" icon, and I can tell you why it's asymmetric if you really want.[1] But the point is that in this H2O molecule, this outermost electron cloud is attracted more to the big strong oxygen atom than it is to the two puny little protons that are bonded to it. It's still a molecule, it's still a covalent bond, it's still hard to rip apart: but there is a little bit more plus-charge near the side with two hydrogen atoms than the opposite side with the butt of the oxygen atom. This slight charge separation over a certain distance is called a "dipole moment," we say that water is a "polar" molecule.

It turns out polar molecules, because like charges repel while opposites attract, can stick better to other polar molecules than to nonpolar ones. They just can twist against each other into lower-energy configurations. So this makes water stick to itself, say, more than it sticks to a nonpolar thing like oil (which is made of highly nonpolar carbon-carbon and carbon-hydrogen bonds).

Cells and their walls

Your body uses this to great effect to create cell walls. So as we start to talk about "you are made up of organs which are made up of tissues which are made up of cells which are made up of organelles," you get to talk about the phospholipid bilayer around each of your cells. This is a thin membrane formed by two layers (bilayer) of molecules (phospholipids), each with a thick phosphate-containing "head" and two stringy fatty (lipid) "tails" that both jut out on the same side.

The trick? The "head" of this thing is polar, but it's covalently bonded to these tails which are these nonpolar hydrocarbon chains. In water, all of the hydrocarbon chains want to get away from the water, so these things naturally twist around to form surfaces where the polar "heads" point outwards and the nonpolar "tails" point inwards. We say that they "self-assemble" into a bilayer, literally the water would rather be around other water so much that it accidentally kicks these things together until the phosphate groups are on the outside--these, it doesn't kick so hard. You really have to imagine the microscopic world as a constant storm of particles bashing up against each other to understand this self-assembly process!

Then the cell will often embed all sorts of other junk inside these cool boundaries by giving that junk a fatty center with polar outsides, so that it wants to "stick" inside the layer. This might include a channel to let water in or out, or how the injector needles that malicious bacteria can use to infect your cells are embedded within their walls -- or any number of other things like that! Cells often have "hairs" sticking out that help hold water molecules nearby or sometimes help them crawl around their environments.

So when your skin is touching the table, it's actually a layer of dead skin cells and hairs and such, with lots of room for air gaps, touching the table. Even if your cells themselves touched, they probably have a lot of stuff around them which keeps their actual phospholipids from touching the cell. And even if those touch the table and some of them get left behind, the rest of the ones on the nearest cell will spontaneously want, in any wet condition (and your body is one big wet condition!) to "fix" that wall.

It's just added layers of complexity atop these basic ideas that "molecules stay together more than they stick to other molecules, and some molecules attract these other molecules with a different strength than they stick to those other molecules." If you can master those basic physics ideas, then the rest is biology.

  1. It comes from a sort of strange situation where the outermost shell of the oxygen atom has 8 different electron-pairs and they all want to spread out symmetrically about the oxygen atom, so they spread out like the corners of a tetrahedron: and 2 of those pairs are wrapping these protons up, so those two are basically on the points of the tetrahedron, and no two points of a tetrahedron are 100% opposite each other.

It is indeed basically electrostatic forces that keep solids solid. They also keep atoms and molecules together, so the basic question is why some atoms (or molecules) clump together to make a solid and some don't. Even that is an oversimplification, because e.g water molecules are a disorganized collection (aka "gas") in the vapour phase, but if you reduce the temperature enough they clump together to make ice. The basic underlying idea is that they do what is energetically most advantageous: if the total energy can be reduced by forming a solid crystal, they will try to do that; but if the temperature is high enough, their kinetic energy will not allow them to "settle" in one place. The calculation of these things is difficult (and approximate) and it requires quantum mechanics: see e.g. Anderson's "Concepts in Solids" for that. Instead, people assume that there is a solid structure (generally a crystal, although there are amorphous solids, as well as glasses - which are very viscous liquids even though they feel "solid") and proceed to calculate from there.

Note that generally objects are electrically neutral, so there is no electrostatic attraction over all: your hands don't fuse together or to the table. But if you polish two pieces of something sufficiently well, so that when you put them together, the molecules of one piece are close enough to the molecules of the other so that they can "see" the inner structure, it's as if they are the same piece: they will fuse together. It's just that the molecules of your hands cannot get close enough to the molecules of the table for that to happen.

This is just a rough description using "poetic" language - things are more complicated than what I described, but I think the description above is accurate enough to be helpful.

EDIT: A large component of the stability of matter is the Pauli exclusion principle. Indeed, without it a lot of the things that you describe (sticking your hand through your desk e.g.) might very well be possible. I don't know if there is a better introduction somewhere, but absent that, the short section on the stability of matter in the Wikipedia article will have to do. It contains a reference to an article by Elliott Lieb that should be of interest, plus a reference to a 1968 paper of Dyson and Lenard containing a "rigorous" proof of the stability of matter (the article was published in 1968 and AFAICT is not available on line, but a Google search for "Dyson Lenard stability of matter" produced a number of interesting-looking results).

EDIT: According to Dyson, their proof was long and complicated and a "bad" proof, but its principal contribution was that it gave courage to Lieb and Thirring to come up with a much shorter and much better proof. See the review article by Lieb and the wikipedia article on Lieb-Thirring inequalities.