On mainnet currently there is a 10 million gas limit per block, so that is the maximum. According to the Ethereum yellow paper, the fee is 20k gas to store a 256 bit word. A kilobyte is thus 640k gas, which makes 20kb impossible to store on mainnet and extremely expensive anyways. You’ll want to look into signing your data and storing the hash of it onchain.