The way it generally happens on XMPP and Matrix is that the upload is stored at the sending user's server, and a URL is passed around. That means the choice is up to the operator of the sender's service as to what size files they allow, and how long for.
Applying this model to the case of a 4K video sent from iMessage, the file would be hosted by Apple, and you would merely receive a reference to it (i.e. URL) so you can fetch it when you come back online. It's natural to assume this model, as most platforms are already using it today, but of course this is all speculative until things get opened up.
On a final note, Pidgin is a poor choice of example in this case. It supports a much older version of XMPP, its support for the protocol actually hasn't evolved much in the past ~10 years or so. In particular it's missing support for this very file transfer mechanism, and a whole bunch of other things such as multi-device and modern E2EE (though there are third-party plugins attempting to plug some of these gaps). If you're planning to do XMPP in 2022, practically any other XMPP app that's actively developed supports the newer mechanism and many other modern features Pidgin lacks. For desktop that includes Gajim (cross-platform), Dino (Linux, experimentally Windows) and Beagle IM (MacOS).