To display or change the rating of the currently playing song, tap on the artwork in the Now Playing screen. This will toggle between the normal view and the ratings view and will display the number of stars.
If the song is not rated, you'll see five dots instead of stars. You can change the rating by tapping on any position.
Songs that are rated four and five stars will be automatically added to the "Top Rated" smart playlist.