Some countries have implemented some very high tax rates, but did any country, in recent history, implement a ceiling on all earnings (wages and capital gains) in an, otherwise, self-regulated market? If yes, what effect did it have?
In all likelihood, no one has knowledge of every arrangement similar to an income cap anywhere in the world that had a market based economy for all of time. This answer is limited to the modern era U.S. and U.K., with which I have familiarity.
This answer also seeks to limit itself to the observed outcomes directly rather than hypothesizing possible effects based upon economic theory.
The U.S. and the U.K. During WWII
As noted by @michu in comments, during the Second World War, the highest income tax rate in the UK was 99.25%, which is so confiscatory that it amounted in substance to a prohibition on earning more income than that amount. This rate was then slightly reduced and was around 90% through the 1950s and 60s.
Similarly, in U.S. federal income tax law, in 1944, the top rate peaked at 94 percent on taxable income over $200,000 ($2.5 million in today’s dollars) which was also very close to a prohibition on incomes in excess of that amount, particularly when one keeps in mind that this income would also have been subject to state and local income taxes in the jurisdictions that had state and local income taxes at the time (which many jurisdictions did).
The meager proceeds remaining after the 94% top marginal tax rate and any applicable state and local income tax rate also would still have been taxable to the persons receiving the remainder in the estate of the person who earned it after they died through the federal estate tax and coordinated state level estate taxes.
So, this tax was a practical matter, more or less identical to the one in the U.K. despite modifications to reflect the federal nature of the U.S. relative to the unitary government of the U.K.
If yes, what effect did it have?
These wartime caps, which were short lived, mostly involved affected parties capping their income and using excess funds for deductible purposes like paying employees or making charitable donations that built up goodwill in the future since they couldn't receive the compensation itself.
It is also worth noting that the caps were sufficiently high that the number of people affected by them in the U.S. and in the U.K. respectively, was very small. This is because you can't just adjust for inflation to compare the cutoffs to the income levels of people today. You also have to adjust of the fact that the total share of each respective nation's income that was earned by, for example, the top 1% of income earners, was significantly lower in the World War II era than it is today, and that inflation adjusted incomes were lower, on average, than today, due to the less productive economic processes that were in place at the time as a result of lower levels of technology in use in the economy at the time.
The number of people affected then would have been approximately comparable to the number of people affected today by a cap in the many tens of millions of U.S. dollars or more per year.
In other words, part of the reason for the cap was to create national solidarity behind the war effort and for propaganda purposes, so that people with lower incomes making various sacrifices wouldn't feel like chumps and shirk from burdens applied to them, rather than for the significance of their direct economic effect on high income earners. There is every reason to think based upon anecdotal historical evidence, such as oral histories of the time period, that these caps were effective at producing this social psychological reaction to some degree or another, although this is difficult to quantify.
Social psychology and economics studies tending to target this kind of thinking suggest that it is a policy that was effective because most people evaluate their own well being more on a relative basis rather than on an absolute basis.
A U.S. Tax Code Provision That Looks Like A Cap But Isn't
There is a provision of the current United States Tax Code which superficially looks like a $1,000,000 cap on compensation, but upon closer examination, is really only a cap on the cash salary compensation of executives of publicly held corporations (who admittedly make up most of the highest income individuals in the U.S., making it look like an imperfect but significant income cap) that has a massive loophole for equity based compensation look stock options. It is codified at Title 26 of the United States Code at Section 162(m).
If yes, what effect did it have?
It is uncontroversial, however, this cap has a widely known loophole and is not a real cap.
Indeed, it is widely agreed on a bipartisan basis that this has, in practice, actually increased rather than decreased total executive compensation for executives of U.S. publicly held corporations as explained for the uninitiated by Pro Publica (the first easily linkable and easy for non-tax specialist to read reference I came across, but this empirical reality is widely, although perhaps not universally, acknowledged across the political spectrum).
Whether the higher executive compensation resulting from this policy provided commensurate benefits by incentivizing executives in a way aligned with shareholders, however, is controversial.
The Medicaid Means Tests In The U.S.
While it is also not the same, for purposes of evaluating the economic impact of such a policy, it is also fruitful to examine how means tested public benefit programs with an income cap.
For example, manny components of the joint federal and state program called the Medicaid in U.S. has an income cap set by regulation for beneficiaries in each U.S. state on a state by state basis pursuant to federal guidelines.
In Colorado, in 2022, the cap is $2,523 per month for a single applicant who will be living in a nursing home, $5,046 per month for married applicants who will both be living in a nursing home. There is a substantially identical cap of $841 of income per month for a single applicant and $1,261 a month for married applicants who are both applying, and $3,000 a month for married applicants only one of whom are applying, for non-elderly adults seeking this means tested health insurance coverage and for non-elderly adults seeking Medicaid health insurance coverage because they are blind or disabled, or for elderly adults seeking Medicaid health insurance to supplement their Medicare insurance or because they don't qualify for Medicare insurance (which is not means tested).
Under these programs, in order to be eligible for Medicaid benefits under the programs in question, any income in excess of the income cutoff must be put in a trust for the benefit of the Medicaid program, effectively confiscating all income in excess of the regulatory set level for program beneficiaries.
But, since many Medicaid beneficiaries have a life or death need for coverage under the Medicaid program and don't have sufficient income to pay for what Medicaid covers out of pocket even if they retain all of their income to do so, there is really no other choice for them but to forfeit their excess income.
If yes, what effect did it have?
As a practical matter, few beneficiaries eligible for the programs for nursing home care, and for health care for the disabled could have earned particularly high incomes even without the cap, in light of the conditions that make them eligible for the program, so the primary effect is to limit the amount that beneficiaries can consume from pensions and from income from property (although the latter is very modest due to a parallel asset test to qualify for benefits), and the formation, at high transactional costs, of trusts to allow applicants who have a life or death need for the benefits to qualify for them.
For people who are on the "low income" part of the program, this has created a step hump with a negative effective marginal income tax rate, that helps trap beneficiaries at low incomes in order to get needed health insurance, but this was significantly mitigate with a parallel low income program as part of the Affordable Care Act (a.k.a. Obamacare) in the 38 or so U.S. states that did not opt out of Medicaid expansion.
I don't have easy, linkable access to the economics literature analyzing the empirical impact of these programs, but there are professional academic economic studies that have examined this question and reached essentially the conclusion set forth above.
In the year 2013 The Netherlands adopted the so called 'Balkenende Norm'. After a public outcry of the high salaries of government employees the new laws and guidelines were introduced which effectively limited the salary of a government employee to a maximum of 130% of the salary of a minister in the government.
In 2015 it was shown that only 5 people still had a salary which exceeded the 'Balkenende Norm'. So for this it was quite successful.
I failed to find additional information on other, maybe unwanted, side effects of this.
In a free market economy, the sum of all capital equals the sum of net worth of all persons.
In a partially state-owned economy (which is basically every one) the sum of all capital is more than the sum of net worth, but only in case of very un-free economic system such as one of USSR to make the difference on the orders of magnitude.
Whatever you see around - the houses, the shops, the mills, the factories, the fields - is owned by somebody, and that means the somebody can spend up to that amount on their consumption by selling stuff they own. If you find yourself not owning a sizeable amount of houses, shops and factories, somebody else surely does.
Of course, you can wrap property in mutual funds, banks, cooperatives, etc, etc - but eventually all of these structures are owned by people who can cash out their share.
Thus it is very hard to introduce a working income ceiling. There would be rich people who can sell stuff by virtue of owning it. The only way to not have rich people is to not have an economy.
All kind of ceilings (on price, income, sales volume, etc.) are known to result in market functioning at sub-optimal level - known as deadweight loss, incurring overall losses to the society. Interference into market is thus advisable only when it corrects some gross distortions, such as extreme poverty (e.g., when the income falls below survival level, as was during the Great Depression) or externalities, such as global warming.
If one's income is bounded from above, there is no reason to work any harder than necessary to reach the ceiling. Another well-known unproductive proposition is a 100% income tax - leaving inheritance (and generally giving the best) to one's is an extremely pwoerful human motivation. If one is not allow to work for the benefit fo one's progeny one either tries to spend all the money before one's death or finds a way to bypass the legislation - e.g., by making one's children co-owners of one's business, givig them generous presents, etc.
Can market be controlled?
Another point is that market usually finds ways to bypass a legislation - E.g., in the USSR market economy florished: it was mostly illegal and therefore untaxed, but everyone was aware of how much and to whom one should pay in order to obtaina good or a service that was not available through normal channels.
Another well-known example is market economy in prisoners camps.
The arguments against the maximal possible taxation are summarized by the so-called Laffer curve: the arguments is that one collects zero taxes if the tax rate is zero, but also zero taxes if teh tax rate is 100% - since in this acse no one bothers to engage in any productive (legal) activity. Thus, there is an optimal tax rate somewhere between 0% and 100%, when the government collects maximum taxes.
Thus, drive for maximum taxation is a good litmus test for those who genuinely seek improving social welfare, versus those who just seeking punishing "the rich": genuine welfare in market economy requires giving "the rich" some space to breath.
I saw the folowing quote sometimes attributed to Milton Friedman and sometimes to Churchill:
Some people regard private enterprise as a predatory tiger to be shot. Others look on it as a cow they can milk. Not enough people see it as a healthy horse, pulling a sturdy wagon.