If you are in controlled airspace its very possible ATC will direct you around weather, you can find out more about that in this question.
However what ATC can see on their scope varies from place to place and weather moves quickly. As such pilots can, and often do request deviation for weather. Lets say you are flying along dodging some clouds here and there, popping in and out, and all of a sudden you pop out with a cell forming in front of you. You may request something like:
N123AB requesting left turn 20 degrees for weather
N123AB left 20 approved for weather avoidance
It may also not be a bad idea to file a PIREP to help others out.
Ultimately as pilot in command you can deviate from any rule to ensure a safe flight. If you were about to fly straight through a storm and ATC was not allowing a deviation or not issuing one a case could be made for deviating any way. You can read more about that here.