Portland has some great mountain bike options, it all depends on how long you have and if you have a car. Baxter Woods/Evergreen Cemetery are pretty good, and accessible from town. I would ride there from the waterfront, then cruise out to Portland Head light for some sightseeing. Nothing "epic" but there are some fun trails and it can fill a solid few hours. If you can display trailforks on your device its a huge help navigating around. You can connect Baxter, Evergreen, Fore River and Presumscott pretty easily if you are good with trailforks and ok with riding some city streets.
With a car Bradbury Mtn and Blackstrap are both fun. Again trailforks and/or the Southern Maine NEMBA page are huge helps in finding your way.
You are also pretty close to Conway, NH where a ton of trails have been built in the last few years. Really, really good trails.