You don't need to measure the width. You can use either a tabular
:
\documentclass{article}
\usepackage{color}
\newcommand{\Calendar}[3]{%
\noindent
\ifcase #1\or% 0
January\or % 1
February\or % 2
March\or % 3
April\or % 4
May\or % 5
June\or % 6
July\or % 7
August\or % 8
September\or % 9
October\or % 10
November\or % 11
December% 12
\fi
\\
\textcolor{blue}{\textit{#2%
\ifcase #2\or% 0
st\or % 1
nd\or % 2
rd\or % 3
th\or th\or th\or th\or th\or th\or th\or % 4, 5, 6, 7, 8, 9, 10,
th\or th\or th\or th\or th\or th\or th\or th\or th\or th\or % 11, 12, 13, 14, 15, 16, 17, 18, 19, 20
st\or % 21
nd\or % 22
rd\or % 23
th\or th\or th\or th\or th\or th\or th\or % 24, 25, 26, 27, 28, 29, 30
st% 31
\fi}}
\\
\textcolor{red}{\textbf{#3}}%
\vspace{0.4em}
}
\begin{document}
\Calendar{2}{2}{1989}
\Calendar{1}{31}{1990}
\Calendar{3}{23}{1991}
\end{document}

or tabular
inside \fbox
:
\documentclass{article}
\usepackage{color}
\newcommand{\Calendar}[3]{%
\noindent
\fbox{\begin{tabular}{@{}l@{}}
\ifcase #1\or% 0
January\or % 1
February\or % 2
March\or % 3
April\or % 4
May\or % 5
June\or % 6
July\or % 7
August\or % 8
September\or % 9
October\or % 10
November\or % 11
December% 12
\fi
\\
\textcolor{blue}{\textit{#2%
\ifcase #2\or% 0
st\or % 1
nd\or % 2
rd\or % 3
th\or th\or th\or th\or th\or th\or th\or % 4, 5, 6, 7, 8, 9, 10,
th\or th\or th\or th\or th\or th\or th\or th\or th\or th\or % 11, 12, 13, 14, 15, 16, 17, 18, 19, 20
st\or % 21
nd\or % 22
rd\or % 23
th\or th\or th\or th\or th\or th\or th\or % 24, 25, 26, 27, 28, 29, 30
st% 31
\fi}}
\\
\textcolor{red}{\textbf{#3}}\\
\end{tabular}}%
}
\begin{document}
\Calendar{2}{2}{1989}
\Calendar{1}{31}{1990}
\Calendar{3}{23}{1991}
\end{document}

or varwidth
inside \fbox
to make a box around it.
\documentclass{article}
\usepackage{color}
\usepackage{varwidth}
\newcommand{\Calendar}[3]{%
\noindent
\fbox{\begin{varwidth}{\linewidth}\raggedright
\ifcase #1\or% 0
January\or % 1
February\or % 2
March\or % 3
April\or % 4
May\or % 5
June\or % 6
July\or % 7
August\or % 8
September\or % 9
October\or % 10
November\or % 11
December% 12
\fi
\\
\textcolor{blue}{\textit{#2%
\ifcase #2\or% 0
st\or % 1
nd\or % 2
rd\or % 3
th\or th\or th\or th\or th\or th\or th\or % 4, 5, 6, 7, 8, 9, 10,
th\or th\or th\or th\or th\or th\or th\or th\or th\or th\or % 11, 12, 13, 14, 15, 16, 17, 18, 19, 20
st\or % 21
nd\or % 22
rd\or % 23
th\or th\or th\or th\or th\or th\or th\or % 24, 25, 26, 27, 28, 29, 30
st% 31
\fi}}
\\
\textcolor{red}{\textbf{#3}}\\
\end{varwidth}}%
}
\begin{document}
\Calendar{2}{2}{1989}
\Calendar{1}{31}{1990}
\Calendar{3}{23}{1991}
\end{document}

This does also work for very short month like May, where the yer could be wider than the name of the month. Nevertheless, if you like to measure, use \settowidth
or \widthof
:
\documentclass{article}
\usepackage{color}
\usepackage{calc}% for \widthof
\newcommand*{\Month}[1]{%
\ifcase #1\or% 0
January\or % 1
February\or % 2
March\or % 3
April\or % 4
May\or % 5
June\or % 6
July\or % 7
August\or % 8
September\or % 9
October\or % 10
November\or % 11
December% 12
\fi
}
\newcommand{\Calendar}[3]{%
\noindent
\fbox{\begin{minipage}{\widthof{\Month{#1}}}\raggedright
\Month{#1}\\
\textcolor{blue}{\textit{#2%
\ifcase #2\or% 0
st\or % 1
nd\or % 2
rd\or % 3
th\or th\or th\or th\or th\or th\or th\or % 4, 5, 6, 7, 8, 9, 10,
th\or th\or th\or th\or th\or th\or th\or th\or th\or th\or % 11, 12, 13, 14, 15, 16, 17, 18, 19, 20
st\or % 21
nd\or % 22
rd\or % 23
th\or th\or th\or th\or th\or th\or th\or % 24, 25, 26, 27, 28, 29, 30
st% 31
\fi}}
\\
\textcolor{red}{\textbf{#3}}\\
\end{minipage}}%
}
\begin{document}
\Calendar{2}{2}{1989}
\Calendar{1}{31}{1990}
\Calendar{5}{23}{1991}% Problem!!!
\end{document}

BTW: For more nice boxes see tcolorbox
.
\settowidth
(look it up) on say\Month{#1}
width
is to be queried, why is this tagged with height?\settoheight
and\settodepth
if you need it.