The last element's atomic number
Nobody really knows. Using the naive Bohr model of the atom, we run into trouble around $Z=137$ as the innermost electrons would have to be moving above the speed of light. This result is because the Bohr model doesn't take into account relativity. Solving the Dirac equation, which comes from relativistic quantum mechanics, and taking into account that the nucleus is not a point particle, then there seems to be no real issue with arbitrarily high atomic numbers, although unusual effects start happening above $Z \approx 173$. These results may be overturned by an even deeper analysis with current quantum electrodynamics theory, or a new theory altogether.

As far as we can tell, however, we will never get anywhere close to such atomic numbers. Very heavy elements are extremely unstable with respect to radioactive decay into lighter elements. Our current method of producing superheavy elements is based on accelerating a certain isotope of an relatively light element and hitting a target made of an isotope of a much heavier element. This process is extremely inefficient, and it takes many months to produce significant amounts of material. For the heaviest elements, it takes years to detect even a handful of atoms. The very short lifetime of the heaviest targets and the very low collision efficiency between projectile and target mean that it will be extremely difficult to go much further than the current 118 elements. It is possible that we may find somewhat more stable superheavy isotopes in the islands of stability around $Z=114$ and $Z=126$, but the predicted most stable isotopes (which even then are not expect to last more than a few minutes) have such a huge amount of neutrons in their nuclei that we have no idea how to produce them; we may be condemned to merely skirt the shores of the islands of stability, while never climbing them.

EDIT: Note that the best calculation presented above is based on quantum electrodynamics alone, i.e. only electromagnetic forces are taken into account. Obviously, to predict how nuclei will behave (and therefore how many protons you can stuff into a nucleus before it's impossible to go any further), one needs detailed knowledge of the strong and weak nuclear forces. Unfortunately, the mathematical description of nuclear forces is still an incredibly tough problem in physics today, so no one can hope to provide a rigorous answer from that angle. 

There must be some limit, as the residual nuclear forces are very short-ranged. At some point there will be so many protons and neutrons in the nucleus (and the resulting nucleus will have become so large) that the diametrically opposite parts of the nucleus won't be able to "detect" each other, as they are too far away. Each additional proton or neutron produces a weaker stabilization via the strong nuclear force. Meanwhile, the electrical repulsion between protons has infinite range, so every additional proton will contribute repulsively just the same. This is why heavier elements need higher and higher neutron-to-proton ratios to remain stable.

Thus, at some atomic number, possibly not much higher than our current record of $Z=118$, the electrical repulsion of the protons will always win against the strong nuclear attractions of protons and neutrons, no matter the configuration of the nucleus. Hence, all sufficiently heavy atomic nuclei will suffer spontaneously fission almost immediately after coming into existence, or all the valid reaction pathways to reach an element will require events which are so fantastically unlikely that if even all the nucleons in the entire observable Universe were being collided with each other since the Big Bang in an attempt to synthesize the heaviest element possible, we would statistically expect some sufficiently heavy atom to not have been produced even once.