A value stock bought when undervalued should presumably increase in value and eventually is no longer a value stock. How long should this take and should it then be sold?
The terminology here is a bit confusing. The standard definition of value stock sounds straightforward. According to Investopedia:
A value stock is a stock that tends to trade at a lower price relative to its fundamentals (e.g., dividends, earnings and sales)
In practice though it can depend rather wildly on why it trades at a lower price than its peers. For instance, many Utilities stocks (your local power company) would almost certainly be considered a value stock by most fundamental measures people use. This is because they generally have high dividends but they tend to be highly regulated usually aren't expected to grow any faster than the population in their region. In this case, these stocks could be value stocks for decades on end.
On the other hand a stock could be value stock because it has hit a rough patch and you expect it to recover. In that case, it depends on why you think it is doing poorly now and how soon you expect it to recover. This could be days or years.
In this sense, a value stock may or may not be actually undervalued. As for when to sell, that is never an easy question. When the stock is no longer undervalued? When there is a better risk-adjusted opportunity out there? It depends on your strategy which is important to have set before you invest.
It sounds like you're looking for information regarding value investing, and not just value stocks such as utilities as was suggested. Large stable stocks tend to have solid value (i.e. good fundamentals and very low risk) but are rarely under valued, and therefore rarely a "buy" by value investing standards.
Value investing involves looking at a firm's fundamentals and coming up with an "intrinsic value" per share. From there, you determine if the stock is under or over valued relative to market share price.
In regards to your question, there is no average or expected time it takes for an undervalued stock to appreciate. The idea with value investing is that the market will correct "mistakes" made in undervaluing a company. It could also be that the firm's fundamentals point towards a strong outlook (typically 10 years) and the market has yet to realize this.
A disciplined value investor will sell when their models say that the stock is no longer undervalued. Any interest in that company after that is not value investing and is simply betting on the stock. Of course an investor will update models and change them appropriately throughout the investment period to make sure their models reflect current conditions.
As for the exact time to sell, investors may just sell as soon as they see it is not undervalued, or may look at technical analysis (such as RSI) to determine the day on which to sell.
Hope this answers your question!