Ceiling fans are often wired for two power sources, one to the light and one to the fan. There may or may not be a wall switch for either. One standard way to wire this is to use four-conductor cable, with the additional "hot" power coming on the fourth wire. If you had noted how the fan was hooked up before you dismounted it, that would have helped. But, assuming that this was done by someone who had some vague clue about house wiring...
In the US, the color convention is Black for hot, White for neutral, Green (or, sometimes, uninsulated) for safety ground, and Red for "secondary hot", which may be used for different purposes in different situations. For the ceiling fan, they may have used black to power the light and red to power the fan, or the other way around.
So: In your case, where there's only one switch and it used to control the lights, I suspect that it's in the red circuit rather than the black circuit. You could check that by turning the power off again, opening up the switchbox, and seeing how wires are connected there.
Or you could go for the empirical: Turn power off, dismount the fixture, wire the fixture's black to red, cap the now-unused black in the ceiling, close it up, turn power back on, and try the switch. I'm betting that will do the job.
(Personally, I'd hook a meter across red and white and confirm that red is the switched line before re-attaching the light fixture, but I admit I'm a bit paranoid.)
Generally speaking, you must connect ceiling live cable (CL) to fixture live (FL) and ceiling neutral (CN) to fixture neutral (FN). As comments state, your fixture may not have a ground cable (strictly speaking), but some kind of screw, most probably with proper designation indented on it or with a proper sticker. If that's so, your ground cable from ceiling (CG) will match fixture attachment for ground (FG).
That said we have:
CL > FL
CN > FN
CG > FG
Note 1.: There is a possibility that your fixture may not have proper attachment or cable for grounding. It may happen with old fixtures or these not exactly matching codes. Not preferred to fix. If you omit the grounding step, the fixture will probably work, but it's not recommended.
Note 2.: Screws on fixtures may have designations like N (for neutral) or L (for live). That may help you with doing proper matching and fixing.
Best Answer
These are spring terminals. The wire is squeezed tight in place by the force of a spring. They're very reliable if used properly... there is no screw to get loose.
First, prepare your wire, check the manual for how much to strip, and if it is flexible wire, make sure to turn the strands between your fingers to make it nice and tight, like this random pic from the net. There should be no loose strands...
Use a small screwdriver blade to gently push down the tiny pushbutton on the terminals:
Don't push it sideways or it might break! Pushing it down releases the spring, and you can stick the wire into the hole, then release the pushbutton. Pull on the wire, it should not come out.
If you want to take the wire out, push the button and pull the wire.
If you use solid core wire then you don't need to push the button to stick the wire in. Solid core will find its way in.