Cherry is correct. both can function as an adjective but only “optimum” can be used as a noun. In fact, there are some people who believe that “optimum” should only be used as a noun and it’s only because people have repeatedly used it as an adjective (incorrectly) over a long period of time that it has become acceptable as an adjective.
So if you want to be safe, it would be best to only use “optimum” as a noun. But I’m sure no one would correct you if you used it as an adjective.