A pie is a baked or fried dish which is usually made of a pastry dough casing that covers or completely contains a filling of various sweet or savory ingredients.
A tart is a baked dish consisting of a filling over a pastry base with an open top not covered with pastry.
The pastry is usually shortcrust pastry; the filling may be sweet or savory, though modern tarts are usually fruit-based, sometimes with custard.
Flan, in Britain, is an open pastry or sponge case containing a sweet or savory filling.
A typical flan of this sort is round, with shortcrust pastry.