It’s related to both time and activity.
For new X accounts, this restriction is temporary and usually depends on account behavior rather than a fixed number of days. The more you engage naturally, the faster it typically disappears.
If you confirm the message, it will disappear temporarily...