This tip applies to selfies and photos taken with the rear camera.
In the photo above, I'm standing a little bit away from the wall and the phone booth. It's hard to tell that from the original, non-blurred photo on the left, but it's clear from the photo on the right that there was some distance there. That's how the background was able to blur so nicely.
Portrait mode works best when the camera and the phone's software can easily differentiate between the foreground and the background. When those two things are too close together, or too similar, portrait mode doesn't work as well.
In my experience using portrait mode, it's best to have the subject stand about 1-2 feet away from the background.