This is an excellent question, and one that has different answers depending on context. You mentioned several specific questions each of which might warrant their own answers. I'll try to address them more as a unified whole here.
Q. Is it just a property of the lens?
A. Simply put, no, although if you ignore CoC, one could (given the math) make the argument that it is. Depth of field is a "fuzzy" thing, and depends a lot on viewing context. By that, I mean it depends on how large the final image being viewed is in relation to the native resolution of the sensor; the visual acuity of the viewer; the aperture used when taking the shot; the distance to subject when taking the shot.
Q. Can lenses be designed to give more depth of field for the same aperture and focal length?
A. Given the math, I would have to say no. I am not an optical engineer, so take what I say here with the necessary grain of salt. I tend to follow the math, though, which is pretty clear about depth of field.
Q. Does it change with camera sensor size?
A. Ultimately, it depends here. More important than the size of the sensor would be the minimum Circle of Confusion (CoC) of the imaging medium. Curiously, the Circle of Confusion of an imaging medium is not necessarily an intrinsic trait, as the minimum acceptable CoC is often determined by the maximum size you intend to print at. Digital sensors do have a fixed minimum size for CoC, as the size of a single sensel is as small as any single point of light can get (in a Bayer sensor, the size of a quartet of sensels is actually the smallest resolution.)
Q. Does it change with print size?
A. Given the answer to the previous question, possibly. Scaling an image above, or even below, its "native" print size can affect what value you use for the minimum acceptable CoC. Therefor, yes, the size(es) you intend to print at do play a role, however I would say the role is generally minor unless you print at very large sizes.
Mathematically, it is clear why DoF is not simply a function of the lens, and involves either the imaging medium or print size from a CoS perspective. To clearly specify the factors of DoF:
Depth of Field is a function of Focal
Length, Effective Aperture, Distance
to Subject and Minimum Circle of Confusion.
Minimum Circle of Confusion is where
things get fuzzy, as that can either be
viewed as a function of the imaging
medium, or a function of print size.
There are several mathematical formulas that can be used to calculate the depth of field. Sadly, there does not seem to be a single formula that accurately produces a depth of field at any distance to subject. Hyperfocal Distance
, or the distance where you effectively get maximum DoF, can be calculated as so:
$$
H = \frac{f^2}{Nc}
$$
Where:
\$H\$ is the hyperfocal distance;
\$f\$ is the lens's focal length;
\$N\$ is the f-number (relative aperture) of the lens; and
\$c\$ is the circle of confusion (CoC) diameter.
The circle of confusion is a quirky value here, so we'll discuss that later. A useful average CoC for digital sensors can be assumed at 0.021mm. This formula gives you the hyperfocal distance, which isn't exactly telling you what your depth of field is, rather it tells you the subject distance you should focus at to get maximum depth of field. To calculate the actual Depth of Field
, you need an additional calculation. The formula below will provide DoF for moderate to large subject distances, which more specifically means when the distance to subject is larger than the focal length (i.e. non-macro shots):
$$
\begin{align}
D_\text{n} &= \frac{Hs}{H + s} \\
D_\text{f} &= \frac{Hs}{H - s} && \text{for }s<H \\
DoF &= D_\text{f} - D_\text{n} \\
&= \frac{2Hs^2}{H^2 - s^2} && \text{for }s<H
\end{align}
$$
Where:
\$D_\text{n}\$ = Near limit of DoF
\$D_\text{f}\$ = Far limit of DoF
\$H\$ = Hyperfocal distance (previous formula)
\$s\$ = Subject distance (distance at which the lens is focused, may not actually be "the subject")
When the subject distance is the hyperfocal distance:
$$
\begin{align}
D_\text{f} &= \text{'infinity'} \\
D_\text{n} &= \frac{H}{2}
\end{align}
$$
When the subject distance is greater than the hyperfocal distance:
$$
\begin{align}
D_\text{f} &= \infty \\
D_\text{n} &= \text{'infinity'}
\end{align}
$$
The term 'infinity' here is not used in its classical sense, rather it is more of an optical engineering term meaning a focal point beyond the hyperfocal distance. The full formula for calculating DoF directly, without first calculating hyperfocal distance, as as follows (substitute for \$H\$):
$$
DoF = \frac{2Ncf^2s^2}{f^4 - N^2c^2s^2}
$$
If we ignore print size and film, for a given digital sensor with a specific pixel density, DoF is a function of focal length, relative aperture, and subject distance. From that, one could make the argument that DoF is purely a function of the lens, as "subject distance" refers to the distance at which the lens is focused, which would also be a function of the lens.
In the average case, one can assume that CoC is always the minimum achievable with a digital sensor, which these days rolls in at an average of 0.021mm, although a realistic range covering APS-C, APS-H, and Full Frame sensors covers anywhere from 0.015mm – 0.029mm. For most common print sizes, around 13x19" or lower, an acceptable CoC is about 0.05mm, or about twice the average for digital sensors. If you are the type who likes to print at very large sizes, CoC could be a factor (requiring less than 0.01mm), and your apparent DoF in a big enlargement will be smaller than you calculate mathematically.
The above formulas only apply when the distance \$s\$ appreciably is larger than the focal length of the lens. As such, it breaks down for macro photography. When it comes to macro photography, it is much easier to express DoF in terms of focal length, relative aperture, and subject magnification (i.e. 1.0x):
$$
DoF = \frac{2Nc}{m^2}\left(\frac{m}{P} + 1\right)
$$
Where:
\$N\$ = f-number (relative aperture)
\$c\$ = Minimum CoC
\$m\$ = magnification
\$P\$ = pupil magnification
The formula is fairly simple, outside of the pupil magnification aspect. A true, properly built macro lens will have largely equivalent entrance and exit pupils (the size of the aperture as viewed through the front of the lens (entrance) and the size of the aperture as viewed from the back of the lens (exit)), although they may not be exactly identical. In such cases, one can assume a value of \$P = 1\$, unless you have reasonable doubt.
Unlike DoF for moderate to large subject distances, with 1:1 (or better) macro photography, you are ALWAYS enlarging for print, even if you print at 2x3". At common print sizes such as 8x10, 13x19, etc., the factor of enlargement can be considerable. One should assume CoC is at the minimum resolvable for your imaging medium, which is still likely not small enough to compensate for apparent DoF shrink due to enlargement.
Complex mathematics aside, DoF can be intuitively visualized with a basic understanding of light, how optics bend light, and what effect the aperture has on light.
How does aperture affect depth of field? It ultimately boils down to the angles of the rays of light that actually reach the image plane. At a wider aperture, all rays, including those from the outer edge of the lens, reach the image plane. The diaphragm does not block any incoming rays of light, so the maximum angle of light that can reach the sensor is high (more oblique). This allows the maximum CoC to be large, and progression from a focused point of light to maximum CoC is rapid:
At a narrower aperture, the diaphragm DOES block some light from the periphery of the light cone, while light from the center is allowed through. The maximum angle of light rays reaching the sensor is low (less oblique). This causes the maximum CoC to be smaller, and progression from a focused point of light to maximum CoC is slower. (In an effort to keep the diagram as simple as possible, the effect of spherical aberration was ignored, so the diagram is not 100% accurate, but should still demonstrate the point):
Aperture changes the rate of CoC growth. Wider apertures increase the rate at which out of focus blur circles grow, therefor DoF is shallower. Narrower apertures reduce the rate at which out of focus blur circles grow, therefor DoF is deeper.
Proofs
As with everything, one should always prove the concept by actually running the math. Here are some intriguing results when running the formulas above with F# code in the F# Interactive command line utility (easy for anyone to download and double check):
(* The basic formula for depth of field *)
let dof (N:float) (f:float) (c:float) (s:float) = (2.0 * N * c * f**2. * s**2.)/(f**4. - N**2. * c**2. * s**2.);;
(* The distance to subject. 20 feet / 12 inches / 2.54 cm per in / 10 mm per cm *)
let distance = 20. / 12. / 2.54 / 10.;;
(* A decent average minimum CoC for modern digital sensors *)
let coc = 0.021;;
(* DoF formula that returns depth in feet rather than millimeters *)
let dof_feet (N:float) (f:float) (c:float) (s:float) =
let dof_mm = dof N f c s
let dof_f = dof_mm / 10. / 2.54 / 12.
dof_f;;
dof_feet 1.4 50. coc distance
> val it : float = 2.882371793
dof_feet 2.8 100. coc distance
> val it : float = 1.435623728
The output of the above program is intriguing, as it indicates that depth of field is indeed directly influenced by focal length as an independent factor from relative aperture, assuming only focal length changes and everything else remains equal. The two DoF's converge at f/1.4 and f/5.6, as demonstrated by the above program:
dof_feet 1.4 50. coc distance
> val it : float = 2.882371793
dof_feet 5.6 100. coc distance
> val it : float = 2.882371793
Intriguing results, if a little non-intuitive. Another convergence occurs when the distances are adjusted, which provides a more intuitive correlation:
let d1 = 20. * 12. * 2.54 * 10.;;
let d2 = 40. * 12. * 2.54 * 10.;;
dof_feet 2.8 50. coc d1;;
> val it : float = 5.855489431
dof_feed 2.8 100. coc d2;;
> val it : float = 5.764743587