I wanted to ask the rulings of smoking marijuana; does it invalidate prayer, and if so – for how long? Furthermore, if one wants to use it for relief from mental health issues (such as suicidal ideation in depression) can this be done?

Just by smoking it, although haram, it does not invalidate prayer

As for medicinal use, the cbd oil of it can be used