Crates appear every time you earn a podium spot in a race from the poster screen -- that's 3rd, 2nd, or 1st place.
The type of crates appear according to a schedule. You can't change which crate will appear next by racing differently; just keep racing and you'll see them all. The Wood crates appear most often, followed by the Bronze, Silver and Gold crates in order of increasing rarity. Very occasionally you may find a Crystal or an Epic crate, but you have to play a lot of races to encounter them!
IMPORTANT: You have to have an available slot in order to keep your crate, so make sure you open crates as you get them to clear them out and free up slots!