Update: The ratings feature has now rolled out to the UK and you can rate games you have played, purchased or added to your library.
There appear to be some restrictions or perhaps just a bug or a glitch. It wouldn;t let me rate Gran Turismo 7, saying that I had to purchase it or add it to my library. I have Gran Turismo 7 on disc and I thought that could be the issue, but it is letting me rate Gotham Knights which is also on disc.
It looks like PS5 has gotten a 5-star rating system for PS5 and PS4 games. It looks like the rollout of this new feature is something Sony is doing on their end, and it seems to be taking a while as it is not showing for everyone yet.
Users on Reddit are reporting that you can only rate the game if you have already purchased it. Which makes sense to stop the abuse of the ratings system.
The rating system appears to not be available on the PlayStation App yet and it is not known if Sony plans to roll it out to the app or their web-based PlayStation Store.