SHORT ANSWER
Yes, there were some restrictions on movement during the period 1347 - 51 but mostly (with a few exceptions such as some city states and Poland) they were haphazard and depended on local or personal initiatives and / or religion rather than national governments.
Invariably, the measures that were taken were too little, too late. Further, although it was widely recognized that people got sick after being in contact with the sick, travel and gatherings in the form of pilgrimages and processions were actually sometimes encouraged.
DETAILS
Europe
Parts of Italy were ahead of most other regions in Europe in imposing restrictions on movement. An early example from 1347 was that many Italian ports
began to turn away ships, fearful that they carried the deadly
disease. By March 1348, these protective measures were formalised and
Venice became the first city to close its ports to incoming vessels.
Those they did admit were subjected to 30 days of isolation, later
raised to 40, which eventually lead to the birth of the term
‘quarantine’, for ships were forced to wait in the middle of the
Venetian lagoon before they were permitted to disembark.
Other ports, though, were less cautious:
In the western Mediterranean, tales were told of Plague ships from
Messina being kept from Genoa by wary authorities, but at least one
found port in Marseille, France, in January 1348.
Source: Jospeh P.Byrne, 'The Black Death' (2004)
In Europe, Italian cities led the way in implementing travel restrictions:
Travel bans to or from plague-stricken areas developed early and in
Italy among the northern city-states. In January 1348, Lucca banned
entry to anyone from Catalonia, Genoa, or the Romagna; in Visconti
territories, Milan, Parma, and Padua denied access to any foreigners;
and Venice restricted access to ambassadors.
Source: Joseph P. Byrne, 'Encyclopedia of the Black Death'(2012)
In the case of Milan,
in spring 1348, the duke and his councilors decided on two courses of
action. First, deny entrance to the city to anyone from any place
suspected of plague; and, should plague appear in the city,
immediately isolate cases in their own homes. It worked. According to
Agnolo di Tura, only three families suffered, and Milan avoided the
fate of most urban areas.
Source: Byrne, 'Encyclopedia'
Also in Italy,
in May 1348 the northern city of Pistoia introduced
wide-ranging laws affecting many aspects of daily life. Restrictions
on imports and exports, travel, market trading and funerals were all
brought in, but again to no effect. At least 70% of the population
died.
In Florence, and doubtless elsewhere, groups of people isolated themselves, refusing to admit outsiders to their place of isolation. The writer Giovanni Boccaccio (1313-75) wrote that:
Some people were of the opinion that a sober and abstemious mode of
living considerably reduced the risk of infection. They therefore
formed themselves into groups and lived in isolation from everyone
else. Having withdrawn to a comfortable abode where there were no sick
persons, they locked themselves in and settled down to a peaceable
existence...
Source: John Aberth, 'The Black Death: The Great Mortality of 1348-1350'
Often in Europe, though, people waited with dread before fleeing when the plague struck their locality. People coming from infected communities were, unsurprisingly, mostly unwelcome. For example, the chronicler Geoffrey the Baker wrote that the plague
ravaged Devon and Somerset up to Bristol. As a result, the people of
Gloucester denied admission to people from Bristol, believing that the
breath of those who had lived among the dying would be infectious.
Source: Rosemary Horrox, 'The Black Death' (Manchester Medieval Sources series, 1994)
Despite Gloucester's precautions, the plague spread to there too. It was only when the shortage of labour in England began to affect landlords that laws were passed in 1349 and 1351 which, in addition to attempting to control wage demands, restricted the mobility of peasants. These laws, though, were for economic reasons rather than to prevent the spread of the plague (and they were widely flouted).
Perceived economic necessity was also behind a law in Cahors (France) aimed at preventing people from fleeing the town. The lack of citizens due to fleeing contributed to local financial resources drying up in many areas, hence the advice of the king's advisor:
In August 1348, he told the consuls of Cahors that to raise money for
repairing the town fortifications they should levy stiff fines on
those citizens who had fled the plague and refused to return to the
city.
Source: John B. Henneman, Jr., 'The Black Death and Royal Taxation in France, 1347-1351'. In 'Speculum,' Vol. 43, No. 3 (Jul., 1968), pp. 405-428.
Although it was widely noticed that those who came into contact with sick also got sick (and there are examples of places where people were confined to their homes if they were sick) , the church unsurprisingly focused on prayer, fasting and virtuous living, as did King Edward III in England. Also, far from encouraging people not to travel, the papacy
declared 1350 a Jubilee Year, in which a pilgrimage to the churches of
Rome would earn pilgrims a plenary indulgence – the full remission of
the penance due for their sins.
Source: Horrox
The Muslim World
In the Muslim world, adherents in Cairo were told not to enter a plague-afflicted area, and nor were they to leave it. Many held to the belief that
the Plague was entirely the will of Allah: it is a mercy to the
faithful victims, since they will go immediately to Paradise, and
punishment for the infidels.
Source: Byrne, 'The Black Death'
Thus,
Muslims were to neither flee nor enter a place where the Plague raged
After 1351
The plague recurred many times over the following centuries and, while it often went unchecked, precautions were taken in some places:
A document from 1377 states that before entering the city-state of
Ragusa (modern Dubrovnik in Croatia), newcomers had to spend 30 days
(a trentine) in a restricted place (originally nearby islands) waiting
to see whether the symptoms of Black Death would develop.[13] In 1448
the Venetian Senate prolonged the waiting period to 40 days, thus
giving birth to the term "quarantine".
By the 15th century at least, some authorities were becoming more organized. In parts of Italy, Bills of Health (certifying that the bearer was healthy) for travellers were common:
In 1494 the Florentine government reconstituted the health board with
which they had experimented in 1348. Five men with six-month terms
kept watch on where the Plague was being reported, provided clean
bills of health for Florentine travelers, and condemned violators of
sanitation laws. As Luca Landucci pointed out in his diary..., during
the epidemic of the late 1490s they also expelled poor victims of
disease from the city, an action taken by many cities in Europe.
Source: Byrne, 'The Black Death'
However, it took longer for the idea of Bills of Health to take hold in England:
The earliest known English example is York, which required
certification from people arriving from plague-stricken Maldon in
1536; York was a century ahead of most of England.
Source: Byrne, 'Encyclopedia'