A yard is simply [AHD]
A tract of ground next to, surrounding, or surrounded by a building or buildings.
What one expects it to look like or to be used for depends on the building in question, but yard as paved open ground adjacent to a building certainly survives in American English in terms like schoolyard, lumberyard, barnyard, stockyard, or junkyard.
If the building is a "single-family" residence (i.e. detached or semi-detached), then one usually distinguishes between the front yard, situated between the house and the road, and the backyard, which extends behind it to the edge of the property; telling children to stay out of her yard is ambiguous and requires context to determine which yard is meant. It is possible to say side yard as well, although where such land exists it is usually only a strip to allow access, and not usable open space. The analogous terms in BrE appear to be front garden and back garden.
But what any of them looks like or is used for should not be generalized. There is huge variation in their size, orientation, and maintenance across all of the climates, social customs, local ordinances, and neighborhood ages to be found in the U.S. The television sitcom suburban house on a quarter-acre plot with a manicured front lawn and treehouse in the back is not possible or practical in a very large swath of the country.
The British sense of garden for any cultivated land next to a house is not used, except perhaps in New Jersey's nickname of The Garden State. Rather, a garden is an area of the yard (or of flower boxes or planters) where specialized plants are grown: flower garden, rose garden, vegetable garden, herb garden, and so on.
A courtyard is an architectural feature [AHD]:
An open space surrounded by walls or buildings, adjoining or within a building such as a large house or housing complex.
One cannot simply lay down a strip of pavement beside the house and call it a courtyard without attracting some ridicule (n.b. an icicle crashing through your roof does not give you an atrium, either). A courtyard is larger than a patio or lanai, and probably larger than a terrace, and would be a feature of a large house or a multiple-unit dwelling.