The duration of an A/B test should be long enough to collect a sufficient amount of data, but not so long that the results become irrelevant. A general rule of thumb is to run the test for at least a week to ensure that you have enough data to make a decision.