I bought a new violin about a month ago, and its always going out of tune. On average, it goes out of tune in about 2 days. Is this normal? Is there a good method to keep my violin tuned for long periods of time (maybe a month or two)?
As the comments point out, it is completely normal to re-tune multiple times in a day, or even in a performance. In fact, every instrument in an orchestra checks tuning often. String instruments are sensitive to humidity and temperature, and to a lesser extent the bow-drag affects string tension. Wind instruments change as the warm breath heats the physical material and changes the diameter of the bore or length of the tubing.
So pretty much everyone except the glockenspiel and vibraphone players (and cymbals...) have to retune.
I am 50% chastened as the result of some searching thru research papers. It was easy to find papers showing, correctly, that the air temperature strongly affects sound speed and thus note pitch as produced in a wind instrument, and that expansion/contraction effects of the instrument are miniscule by comparison.
What was difficult to find was a discussion of the variability of the musician's exhaled breath temperature. I finally found a very nice bit of research (and I recommend reading the entire paper - if you can't access researchgate, perhaps a direct request to an author, email@example.com would work ) which states, in part,
As the air travels inside the instrument it encounters various thermoviscous losses and consequently the temperature drops. This drop across the instrument has been found to be high as 12C . [emphasis mine] As one would expect, the extent of this effect depends on the instrument itself. For example, in a cornetto using the mean temperature of the air column as opposed to the temperature gradient along the bore doesn’t appreciably alter the pitch  and on the other hand, in an experimental study of clarinets  a pitch difference of up to 8.5 cents was observed when the temperature gradient was replaced with an averaged temperature. The heat diffusion is a much slower process than audio acoustic vibrations, hence the air compression and expansion resulting from oscillations behave less like an isothermal process and more like an isentropic process , i.e. the temperature changes will remain local, and hence it would be safer to assume a varying temperature gradient as opposed to an averaged temperature within the instrument.
Tuning multiples times per day is not uncommon (in fact most violins are in fact constantly tuned), but a violin requiring drastic retuning is most likely a result of several conditions, the most prominent being the weather. If a violin is kept in extreme cold and is introduced to warmer conditions, it will go out of tune. To prevent this from happening, try to keep your violin in a stable environment (temperature, humidity, etc.) when possible.
But no, tuning every few days is not out of the ordinary.
Violin tuning pegs are 'conical': they taper so that they can wedge into the tuning peg holes. It is the friction between the tapered peg and the hole that stops the string from unwinding and going out of tune. When changing strings, make sure you wind the string around the peg so that it winds across to the fat side of the peg and makes contact with the side of the peg box. This prevents any lateral movement of the peg and keeps it tight in its hole. Check all your windings and make sure they are actually touching the side of the pegbox.