These are fairly basic concepts, although I do acknowledge that it's often not discussed explicitly in text books in great depth.
1. When to use risk-free rate?
You use the risk-free rate only when you want to value derivatives (forwards, futures, options... on the stock under consideration).
On the other hand, if you (for example) want to estimate Potential Future Exposure (PFE) on a derivative portfolio against a counterparty, you need to run the Monte-Carlo simulation that computes the PFE under the real-world historical measure, where you would set the stock drift to the "expected rate of return" (often calibrated to historical data). In other words, in the PFE simulation, you first evolve the underlying stock under the real-world measure, and then you'd value the derivatives at discrete future points in time under the risk-neutral measure (using the risk-free rate).
The above might sound complicated, but the crux of it is:
- risk-free rate for valuation of derivatives
- expected rate of return for evolving the underlying to get a distribution of "potential" future prices
The key concept here is that derivative prices are independent of the underlying's future "potential" price distribution (because every market participant has a different, subjective view of these); rather, the derivative prices are only dependent on the underlying's volatility & the cost of borrowing money (where this cost is reflected in the risk-free rate).
2. What risk-free rate to use?
In most cases, we would use the local currency OIS curve to get the corresponding risk-free rate. So for example in USD currency, to value an option that expires in 1 year on some stock, you'd want to get the 1-year SOFR OIS rate.