Tooth sensitivity after having fillings put in or replaced is a common thing.
Some sensitivity is normal after any tooth has been worked on, especially if there has been tooth decay. Decay irritates the tooth, and working on that tooth irritates it further, to where it can develop into a painful sensitivity.
If this is the only cause, expect the tooth to gradually get better, usually within a couple of days, but it can last for several months. As long as the tooth gradually improves, there should be no cause for concern.
The decay could have been close to the pulp of the tooth. In this situation, some bacteria will always be present in the thin porous dentin between the filling and the tooth. With the tooth being irritated from being worked on, it creates a situation in which the tooth can easily become infected. If the sensitivity persists, it indicates that the tooth is not recovering from this tooth infection and will need a root canal. This is fairly uncommon however, but still important to be aware of.
If the tooth is sensitive to biting down, it may need only a simple bite adjustment.
With composite fillings, there is an unusual kind of sensitivity that sometimes occurs. With this sensitivity, the tooth is not sensitive when you clench your teeth together but will experience a sharp pain when food is chewed.
When it occurs, either adjusting the bite where the filling was placed or replacing the filling with another composite filling usually eliminates the sensitivity. If left untreated, the sensitivity may go away over a period of several months, or it may get worse.
There are other possible causes for sensitivity or pain after new fillings. A dental examination may be required to discover another source of the problem.
Bottom line is if you have any kind of sensitivity after a filling is placed well after giving it time to adjust, see your dentist!