Medieval churches were quite literally "oriented," aimed toward the east (the Orient). The choir end, the end of the church where the altar was situated, was supposed to point toward Jerusalem, which in practice meant pointing east. The main entrance of the church and the porch were at the opposite end of the main aisle (nave), so the big doors would open to the west.
The above is an Alsatian monastic church, showing the porch which leads in to the main doors. Pilgrims would often sleep on church porches.
In practice east and west were somewhat flexible. If a church was in a narrow valley, for example, as were some Cistercian houses that sought out uncultivated, wild areas, the church might lie on a northeast - southwest axis rather than strictly east-west. But east-west, lined up with the rising and setting of the sun on the equinox, was the ideal.
At many churches, windows set high above the central aisle were designed to send their light down the central aisle of the church on the longest day of the year (and adjoining days). On the shortest day of the year in the winter, the light would fall instead on the capitals at the tops of the pillars that separated the nave from the side aisles.
For a monastery, which needed a cloister where the monks would spend much of their time, an open square surrounded by roofed walkways, the cloister was generally positioned on the south side of the church, tucked in next to the nave, with the crossing of the church running along the east side. Because the cloister was on the south side of the church, it would be warmer in the winter than it otherwise might be.
Also tucked next to the church in a monastic setting were the buildings where the monks lived and ate, generally the dormitory upstairs, with a stairway to bring them down to the church for the night offices, and a refectory (cafeteria) on the lower level. A big monastery would have a number of other buildings as part of the complex, including kitchens, a guest house, an infirmary, a library, and workshops. The whole would be surrounded by a wall. The church remained the most important structure.