Mormons would certainly be discouraged from using it for
recreational purposes, and such use would be against the (current, modern interpretation of the) "Word of Wisdom" commandment, see
https://en.wikipedia.org/wiki/Word_of_Wisdom.
For medical purposes, it's a much grayer area. Obviously Mormons use drugs medically that would be prohibited by the church for recreational use (opioids, for example). So I suspect most LDS church members and local leaders would be OK with someone using it for legitimate medical purposes--especially if a doctor recommended it. But there's no church policy on it one way or another that I know of. I do recall that the church leaders have come out against a recent proposed law in Utah to legalize medical marijuana, saying that more research needs to be done; see here for example:
https://www.deseretnews.com/article...alls-for-more-study-of-medical-marijuana.html.
As a personal example, my wife suffers from chronic pain. If there were any evidence that marijuana would help for her specific condition (which I don't think there is), then both she and I would probably be fine with her trying marijuana to see if it works (assuming the bill in Utah passes). And I'd consider us to be very active, believing LDS church members.
Interestingly enough, and I hadn't thought about this before in this context, the current LDS church president (as of a couple of months ago) is a medical doctor. Obviously retired from that for many years now, but Pres. Nelson was a very highly respected surgeon back in the day. I wonder if that will have any impact on this discussion.