The term "investors" is a rather vague term, often used in different ways by different people. In the private equity world of companies whose stock is not publicly traded, the term "investors" typically refers to entities who purchase and hold shares in the company. But things are simpler in this context, where it is usually fine to conflate the entities who make the decision to purchase with the entities who then formally own the stock, because it is typical for these to be the same. In the public markets, this is much less true. If you as an individual person purchase 100 shares of Apple (a publicly traded company) in an individual brokerage account, you probably assume you count as an "investor" in Apple. But is your name actually on a stock certificate somewhere saying you own 100 Apple shares? Does Apple know who you are? Not necessarily. Some providers of brokerage accounts put their own names on the stock certificates and hold them "for you."
Things get even murkier if you pool your money with others in a retirement plan, say, and the plan manager decides to purchase shares in a mutual fund, and the mutual fund decides to buy some shares of Apple, a publicly traded company. In this case, who is the "investor"? You? The retirement plan manager? The mutual fund? All of the above? You don't have your name on an actual stock certificate for Apple, but a series of contractual links between financial entities approximately allows you to feel as if you do. And if things work as they should and Apple's share price goes up, you should get a proportional benefit from that.
More generally, in the public markets there are many flavors of separations between those who technically own stock, those that make the decisions of which stocks to buy and sell, and those who have contractual rights to reap the benefits or absorb the losses of stocks that others buy and sell "on their behalf." This makes it challenging to formulate a clear cut definition of the term "investor" that feels right in all situations. Some people make a technical definition of an "investor" that would isolate the mutual fund in the example as the true investor: they reserve "investor" for someone who is making the final decision of what stocks to buy/sell, and doing the buying/selling with someone else's money. For our purposes, it makes more sense to categorize participants by goals rather than by mechanics, so the distinction of whose money is it is less important than what is the goal. A better definition for our purposes might be: an "investor" is an entity who makes a decision to buy or sell a stock in order to express an opinion on the medium or long-term health of an individual company, a set of companies (e.g. a sector of the economy), or the stock market holistically (e.g. through an index like the S&P 500). The opinion might be positive or negative: a short-seller, for example, expresses a negative opinion about the outlook for a particular stock by selling stock they have borrowed rather than own. If the stock price goes down, they will be able to buy the stock at a low price and return it to the lender, making a profit off the negative trend.
The shrewd reader will note the wishy-washy-ness of the phrase "medium or long-term" - let's say this covers anything from multiple days to months to years to decades. Which is not to say that investors seeking long-term returns won't occassionally buy and sell the same stock within a single day - but we'll make a distinction between investment strategies that are intended (or at least very willing) to hold risk over multiple days and longer time scales and those that are designed to get in and out of positions intra-day (or even in a matter of milliseconds). The short-term strategies we will discuss later below.
Institutional investors are entities like mutual funds, pension funds, and hedge funds that take positions in the stock market with money that is pooled from many individuals. Those individuals trust the insitution to make decisions about which stocks to buy and sell, when to trade, etc., and they also trust the institution to allow them to put money in and out of the pool under agreed upon terms. If the insitution does well, the individuals share in its prosperity, and if it does poorly, they share in its paucity. The goals of the institution are typically stated publicly and known to the individuals contributing, and are typically a mix of growing capital, and controlling and/or hedging risk. To achieve this goal, the institutional investor may do research and formulate opinions about the overall worth of a certain security, sector of securities, or the stock market as a whole, and choose a mix of financial instruments to express those opinions (in the sense that they will benefit if the opinions turn out to be true), and to hedge the risk of the opinions being wrong (e.g. use counterbalancing financial instruments to lower the probability of significant loss). Institutional investors are often colloquially referred to as the "buy-side" within the US equities market.
There is a growing segment of hedge funds whose strategies are driven primarily or entirely by quantitative models. Some of the most well-known quant funds are Renaissance Technologies, D.E. Shaw, and AQR. These types of firms are not to be confused with high frequency traders who also enact computer-driven strategies, but often make trading decisions on a much shorter (e.g. sub-millisecond) timescale, although it is worth noting that some firms employ both high frequency and less speed dependent strategies under the same roof.
Retail investors are individuals who make their own decisions about what stocks to buy and sell, and when to place orders. Essentially, retail investors directly reap the rewards or losses of the trading they direct. There is one technical caveat though, since retail investors send their orders to trading venues through brokers, who we will discuss in detail below. As we mentioned above, a broker might put its own company name on the stock certificates as it trades on behalf of a retail investor, and internally keep track of which customers "own" which stocks. This can create issues if a broker declares bankruptcy, and can't make good on everything on its books. There is insurance that mitigates this issue, provided by the SIPC, similar to how the FDIC ensures savings accounts at banks.
The goal of a retail investor may be similar to an insitutional investor, e.g. achieving a particular balance of risk and potential growth of capital. A retail investor may also be seeking to express an opinion about a particular security, sector, or the economy more generally.