You can't set the time: the time after which the Success and Info messages disappear is fixed, Warning and Error messages don't disappear unless manually closed by the user. As Marcelo wrote, there's a Forge component you could use as an alternative.