Mark Adler's answer to What defines the radius of a ball of gas like Jupiter? in Space SE says:
The radius of Jupiter and the other gas giants is defined, somewhat arbitrarily, to be the radius at which the atmosphere has a pressure of 1 bar. As your question points out, they had to pick something. So that's what they picked. This convention is used for all of the gas giants in our solar system.
However, as ProfRob points out
This definition of planetary radius only applies to planets in our own Solar system.
or really to planets for which we have good atmospheric models due to a variety of detailed observations and measurements made possible by their proximity.
I am not sure if there are accepted definitions of size for exoplanets.
For those observed photometrically (by the depth of the "dip" in the light curve when they cross the faces of their stars) the inferred size will be based on opacity - what diameter occulting disk would produce the same size dip, and for those observed spectroscopically (by the doppler shift of the stars spectral features as it moves around the center of mass of the star and the planet) a size would have to be inferred from the mass based on some model or theory for exo-solar system evolution.
The radius of the Sun used to be defined by opacity (at an optical depth of 2/3). That photosphere radius has some measurement interpretation issues, and remains a subject of investigation. Apparently the IAU got tired of it, so in 2015 the "nominal" radius of the Sun was defined to be exactly 695,700 km. This allows the use of "solar radii" as a unit without everyone wondering what radius to use to convert that to distance units.
While the unit "solar radii" is fixed, I think the photosphere (opacity = 2/3) would be a better choice if comparing stars in conversation. That way you can get a polar and equatorial radius and get an oblateness.
We should source our answer assertions - in this case this user is treated as an an expert in the field of space and planetary exploration over in Space SE.
For more on the Sun's photosphere and it's radius and other things: