You can use a massage gun whenever you want to relieve muscle tension, but it's most commonly used before and after workouts for muscle recovery.
If used before a workout, you’re helping to “wake up” your muscles and prepare for the workout. If used after a workout, you will be aiding the muscle recovery process.