There is no clear-cut rule, but if you structure your app into Screens, and have roughly one view model per screen, then a natural place to retrieve a view model instance is at the start of each screen composable.
You may wrap the screens in Routes to use those as navigation destinations, then you can let the route retrieve the view model and only pass the view model's properties and callbacks to the screen. That has the added benefit that your screen's parameters stay agnostic of the view model, which makes automatic testing and previewing much easier. You should not, however, pass entire view model instances around. That doesn't work well with Compose.
This seems like a reasonable upper bound to how deep in your composable hierarchy you should move the view model instantiation. I would also not recommend doing it much earlier to prevent unnecessary instantiations (certainly not in the activity, unless the view model targets the activity specifically).
You can also have a look at the official example app Now in Android and see how they have done it there.