Spells do only what they say they do. The spell will tell you if it moves with an object or creature you've centered it on.
If the spell moves with the the object or creature it was originally centered on, it will say so.
In the description of the spell Darkness, for example, it states that
Magical darkness spreads from a point you choose within range to fill a 15-foot radius Sphere for the Duration. The darkness spreads around corners. A creature with Darkvision can't see through this darkness, and nonmagical light can't illuminate it. If the point you choose is on an object you are holding or one that isn't being worn or carried, the darkness emanates from the object and moves with it. Completely covering the source of the darkness with an opaque object, such as a bowl or a helm, blocks the darkness.
Emphasis mine. The description for Darkness clarifies when the spell will move based on the point you've targeted, i.e, only if that point is on an object you are holding or one that isn't being worn or carried by another creature.
The spell Fog Cloud, on the other hand, states:
A 20-foot-radius sphere of fog appears within range of you until a wind of at least 10 miles per hour blows it away, or until the spell ends. The fog is centered on a point you choose, spreading around corners and heavily obscuring the area it fills.
This spell mentions nothing about the cloud moving with the object or creature you've centered the spell on, so it does not move with that object or creature.