I'm asking for general, long term causes, and specific ones, like the general and war theorists that decided to actually get rid of cavalry.
And, to come to the original question that brought me to post this, when was the last cavalry charge? Was it recent enough to be photographed/depicted?
Short answer: (armored) vehicles in WW2. Maybe. Not really. If you insist.
Long answer:
There was no definite turning point. The role of cavalry became minimized over the course of the last couple centuries, during which it had stayed very relevant up to and including WW2. Though the armored knight charges that are so ingrained in the public mind had ceased to exist long before, cavalry as a blanket term for "men on horses" has been useful for all this time, constantly changing and evolving into different roles. Many types of cavalry have come and gone, both their making and demise often centuries in the make. In a way, cavalry has its role even today, albeit it an extreme niche, as military/riot police, and some minor recon/patrol forces that operate in environments with extremely poor infrastructure.
Cavalry has a very long history, starting as shaky chariots and very light anti-skirmisher forces, and gradually developing into various forms of well-trained troops that formed the hard core of many medieval armies. Among them: heavy cavalry with outstanding armor and heavy weapons is what people are most familiar with, but over the course of the last 2 millennia, light cavalry has been a far more iconic type of cavalry, being present in pretty much every western culture (post-antiquity) and fulfilling critical tasks. Throughout the centuries, the fast-moving rider that can scout, quickly move around the battlefield and harass light troops or cut down routing units has been essential. It's remained useful in that simple form for an immensely long period.
/u/Bacarruda gave a fine overview of the various types of cavalry that existed around the 18th and 19th century here a while back, and I'd very much recommend reading it for information about cavalry in that time period. For the bigger picture, it's important to note how different cavalry in the 18th century already was, compared to the archetype of the heavily armored medieval knight. Gunpowder weapons had completely changed the dynamics of war, but cavalry as a whole did not instantly become obsolete, rather a very specific type of cavalry became outdated; namely the fully armored knight, drawn from an aristocratic caste. The reason why it became outdated should be clear: classic medieval knights were an elite force. They were extremely expensive to raise and maintain, both in terms of time and material, and drawn from a small pool of aristocracy, yet they could incur serious losses when facing even early firearms, and that gradually made their use impractical at best. But heavy cavalry in general did not cease to exist. It stayed useful and thus held on for much longer. They gradually ditched the armor, the life-long training, and the nobility requirements and that alone extended their use on the battlefield by several centuries.
The same occurs for various other forms of cavalry. From antiquity to the medieval period, skirmisher cavalry and cavalry archers were seriously dangerous forces. Skirmisher cavalry used to be a potent skirmishing force, but was -among other things- pretty much useless when faced with opponents that had foot archers with their much greater range... but not every culture in every period had those. So they only gradually fell out of favor as foot archers became commonplace. And cavalry archers fell out of favor for all the same reasons foot archers did (I'd recommend doing a subreddit search on that one, if you want to know more. There's been so ridiculously much written on that, I don't want to waste words on it here). Cavalry archers didn't stop being dangerous. They were just no longer practical, compared to mass infantry equipped with firearms, hence why they didn't spontaneously cease to exist (never mind how slowly military technology permeates through the world) but rather slowly diminished and eventually stopped being altogether. Various types of 18th/19th century cavalry still had some basic breastplates, but gradually they lost it as the vulnerability of cavalry in a charge on the open field became more and more pronounced, as both rifles and cannons became more accurate, and faster firing. So that at the start of the 20th century there's hardly any cavalry with breastplates and swords left. Hardly.... The French infamously charged into battle in WW1 with heavy cavalry in colourful uniforms, shining breastplates and sabers drawn, and paid the price for it. Only after that, the glorious cavalry charge wholly ceased to exist. And so we arrive at the end of cavalry, right?
Nope. With motorization only in its infancy, the world wars saw widespread use of cavalry. In fact, WW2 saw the deployment of over 90 divisions of "cavalry". Most of these, around 60 at the peak, were from the Soviet Union; the other big time users were Nazi Germany and the Balkan states, but every army at the onset of WW2 had cavalry to some extent. With around 7,000 men in a cavalry division, that's close to half a million cavalry for just the Soviet Union. Ironically this completely dwarfs the numbers of cavalry in conflicts in antiquity and the medieval period! But what did this cavalry look like? Well, mostly they were mounted infantry; basically just normal infantry, with a horse for transport. It'd existed for centuries already and the concept still worked. Cavalry in WW2 fought as regular infantry, with largely the same support equipment, artillery, et cetera, but used horses for strategic movement, and occasionally tactical movements as well, but they (with some extremely minor exceptions) did not fight on horseback at all. The benefits are pretty evident: horses can carry more supplies than humans, can travel greater distances per day, and very importantly: you don't need to produce them, and they don't need gasoline. Sure, horses needed to be bred, and maintaining the horse population was actually a big concern for countries like Nazi Germany, but they were far more readily available than trucks at the onset of WW2. Cavalry was also frequently used for reconnaissance, as a single attachment, added to normal infantry divisions, used to draw artillery pieces, and most importantly of all: logistics. Far greater than the number of mounted troops is the number of horses used for logistics. Not what anyone means with "cavalry" but it's very much worth noting.
But this is not the whole picture on what WW2 "cavalry" looked like, because before, during, and after WW2, the actual cavalry-part of cavalry was slowly being phased out. Truck (and car) production soared throughout the war (whereas the horse population growth declined massively due to war losses), and armies rapidly motorized their troops. This was driven by the increased productivity of factories, which lowered the cost of trucks, as well as more robust designs (the reliability of many types of trucks was lacking, diminishing their use) making trucks increasingly more reliable than horses (in regions with roads). Horses aren't with their own, very significant drawbacks, which include the enormous amounts of fodder that they need, lower weight capacity, the big training requirement for riders, and a great vulnerability to the environment and diseases. One more notable disadvantage that mounted infantry had compared to motorized infantry, is the lack of speed. Armoured and motorized divisions outpaced leg infantry by so much that leg infantry was a big liability in fast offensive operations, falling behind so much that faster divisions could be encircled, and pure cavalry did not have the speed to keep up either. The reasons why countries didn't completely motorize all of their cavalry before WW2 is thus a big question and the answer is worthy of its own thread I think, being a combination of the budget choices and doctrines of the various armies. But throughout the war, cavalry divisions were often the first to be partially or completely motorized/mechanized, and this could mean a lot of things: either some, or all of the horses were replaced with trucks or armored cars, or tanks or armored cars were added in various quantities to the divisions, or brigades were swapped and divisions merged into bigger motorized/armoured divisions. This is worth keeping in mind, when seeing a division or brigade in WW2 with the 'cavalry' nametag; it doesn't actually mean it was a pure cavalry division. For that you need to check the actual composition. Nonetheless, mounted infantry remained a very common thing up to the end of WW2.
Lastly, armored vehicles and airplanes replaced cavalry recon, and trucks also took over the logistical aspect, being far superior at both of those tasks, but especially the latter. So where is the "turning point" here? I'd argue WW2 is probably the best turning point you're going to get, with the rise of mass truck production. But cavalry had been slowly on its way to obsolescence for centuries by then, it wasn't actually all that obsolete compared to leg infantry, and had become unrecognizable next to the 'cavalry' as it existed (1)500 years back.
Toward Combined Arms Warfare: A Survey of 20th-Century Tactics, Doctrine, and Organization, Captain Jonathan M. House, August 1984
HANDBOOK ON U. S. S. R. MILITARY FORCES, WAR DEPARTMENT WASHINGTON 25, D. C., 1 March 1946
/u/LuxArdens has done a good job explaining the reasoning, so I won't elaborate on that.
As far as the "last" cavalry charge, a lot of it depends on what specifically you'd qualify as a cavalry charge, but the Polish-Soviet War in the aftermath of WW1 had a lot of large-scale cavalry operations. The 1920 Soviet counteroffensive near Kiev saw the Soviets make excellent use of cavalry by Budyonny's 1st Cavalry Army to slip large forces around the gaps in the Polish lines and force the Poles to withdraw. Budyonny's forces remained a major component of the Lvov theater up until the end of the war, and the Battle of Komarów would see Polish cavalry forces play a decisive role in the defeat and near destruction of Soviet forces in the area. The Polish Uhlan regiments would conduct several cavalry charges during this battle, nearly overrunning the 1st Cavalry Army and forcing Budyonny to abandon his staff car to avoid capture.
One thing to note, however, is that the cavalry forces in this war greatly benefited from the disorganization of the period. The forces at play on both sides were much more poorly organized and equipped than those a few years earlier on the Eastern Front in WW1, and the numbers available were small enough to prevent there from being a single coherent line - especially during the Kiev campaign. Because of that, cavalry were able to take advantage of the situation. Poor reconnaissance meant it was easier for cavalry forces to maneuver around and attack unprepared forces - in fact, that's exactly what happened at Komarów. The sparse placement of forces often created large gaps that forces couldn't adequately cover, allowing for breakthroughs like that performed by Budyonny around Kiev. Poor organization and supply meant that forces were less likely to be able to create defensive positions to adequately fend off cavalry attacks, and the shock value of cavalry on morale was going to impact soldiers more. Just before Komarów, at Zadwórze, we see what happens when even Budyonny's infamous Cossacks went up against a determined, dug-in force. At Zadwórze, a little over 300 isolated soldiers defending a village managed to fend off several attacks and stall the 1st Cavalry Army for a day before being overrun.
Cavalry didn't become outdated. Modern armies still have "cavalry" formations that fulfill the classic roles of the cavalry: scouting, flank protection, moving mounted and fighting dismounted, exploitation, and the like.
Horse cavalry became outdated. As technology advanced, vehicles like trucks, helicopters, and tanks became better mounts than horses. From the mid-20th century onwards, cavalry troopers continued their old duties of scouting and mobile action, only this time on metal mounts.
Granted, some roles of cavalry did become outdated. Cavalry charges, for example, were a very risky proposition in 1914. From the late 19th century onwards, the prevalence of faster-firing artillery, repeating rifles, and machine guns meant that charging cavalry had to be smart (choose hidden approaches, do good pre-attack recon, and time things right) and lucky (have good terrain, catch their target by surprise, and hope their target didn't have any nearby friends). Most of the time, cavalry just wasn't that lucky. As a result, the "shock attack" with lance and sabre became less common and cavalry tended to move mounted, but fight dismounted with rifles and carbines.
This previous answer about how training and mobility helped make cavalry obsolescent and this answer about manpower usage (many cavalry units were dismounted in WWI and WWII to make up critical infantry shortages) may be of interest to you. You also may like this discussion about firepower and this post about the Battle of Halen, the debates over the future of cavalry, and the role of cavalry in 1914 over at r/WarCollege.
u/jonewer also has an excellent post about British cavalry in WWI that deals with the changing role of cavalry during this war.