What country are you from? Because mandatory military service duration varies quite a bit depending on where you live, and the requirements are different too.
In some Latin American countries like Colombia, for example, service lasts around 18 months, while in others like Mexico it technically exists but basically isn't enforced. In countries like Argentina or Chile, when it did exist, it lasted between one and two years. What is common though is that if you don't show up without a valid reason, you can face penalties ranging from fines to legal problems when trying to process important documents like a passport or ID card.
The best thing you can do is look for specific information on your country's defense ministry website or whoever's in charge of military service there. They almost always spell out clearly how many months it is, what happens if you don't show up, and whether there are exceptions or alternatives to traditional service. You can also go straight to the recruitment office with your notification and ask face to face - that way you get everything sorted at once.