Quoting from RFC 4492
All ECDH calculations (including parameter and key generation as well
as the shared secret calculation) are performed according to [IEEE 1363, 2000]
using the ECKAS-DH1 scheme with the identity map as key derivation function (KDF), so that the premaster secret is the x-coordinate of the ECDH shared secret elliptic curve point represented as an octet string. Note that this octet string (Z in IEEE 1363 terminology) as output by FE2OSP, the Field Element to Octet String Conversion Primitive, has constant length for any given field; leading zeros found in this octet string MUST NOT be truncated.
More specifically, it is the byte count of the prime of the Elliptic Curve Field
that you are using to exchange your keys.