The expression "save for the rainy days" talks about saving resources for times of scarcity.
Is there any equivalent expression in Portuguese?
There's an expression in Portuguese (brazilian, afaik) which is
Tempo de vacas magras
This can be literally translated as "Time of thin cows". It means exactly that it's a period with scarce resources, and it's a saying rather than a direct translation. I think it can be used in the context you mentioned, so:
Guardar para o tempo de vacas magras.
As a real example, check this news article which quotes Brazil's President Dilma Rousseff:
...a presidente Dilma Rousseff afirmou a integrantes da Frente Nacional de Prefeitos que este ano será de "vacas magras". De acordo com relatos de quem participou do encontro, a petista lembrou ainda que o contingenciamento do orçamento "será grande"...
Which can be translated as
... president Dilma Rousseff said to members of the Mayors National Front that this year will be of "vacas magras". According to statements of the event's attendants, the petista also noted that the budget contingency "will be large".
As pointed out by @ANeves in the comments, the inverse expression also exists:
Tempo de vacas gordas
In that case, it means that a period has plenty resources. It's usually used in the context of highlighting that, even though the resources are/were plenty, they might not always be like that, so care should be taken or that this should be considered in whatever is being analyzed or described. For example:
Ele estava muito rico no ano passado, mas era um tempo de vacas gordas.
He was very rich last year, but it was a time of fat cows.
You could use:
Portuguese: Guardar para época de vacas magras
English: Save for the slender cow season
Portuguese: Poupar para o dia de amanhã
English: Save for tomorrow
Don't be confuse for similar jargons like
Those can be used to similar situations, but it's not as accurate translation of what you want
Basicamente refere-se a economizar, e não tem uma frase diretamente equivalente no português, você pode utilizar, entre outras, as seguintes frases:
Basically refers to save, and does not have an equivalent in Portuguese, you can use, among others, the following phrases: