Hi,
iMovie 10 has a 16:9 (horizontal) aspect ratio that cannot be changed. So, if one recorded the video or photo in 16:9 one cannot change it to 9:16 in iMovie unless you crop the clip to 9:16 (vertical). Cropping would cause the cropped portion of the display to be eliminated. Cropping may work fine if the eliminated portion is not essential to the clip's display.
For example:
If you have a 16:9 clip like this . . .

You could crop it to 9:16 in the Project Media browser (not the timeline) and get this:

The 9:16 shot in the second image is only approximate because I had to eyeball it to make the crop, as iMovie does not have settings for precisely cropping. As you can see, some of the display was cropped out, but in this case it was not essential. Also, there are black bars around the clip to make it fit iMovie's 16:9 screen. To get rid of the black bars on export, use the crop tool to rotate the clip sideways, then export it sideways to your desktop, and then open it in QuickTimePlayer and rotate it right side up again. That will give you a 9:16 clip without black bars.
There are apps that can change aspect ratio, but unless cropping is used there likely would be distortion resulting from cramming a 16:9 clip into a 9:16 aspect ratio.
-- Rich