When you say
\newcommand\mycommand[1]{
\catcode`\@=0
\catcode`\\=11
@textbf{Hello #1}
@catcode`@\=0
\catcode`\@=11
}
TeX stores the following tokens as replacement text for \mycommand (the • bullet separates tokens and spaces are used for legibility, <sp> denotes a space token):
<sp> • \catcode • ` • \@ • = • 0 • <sp> •
\catcode • ` • \\ • = • 1 • 1 • <sp> •
@ • * t • e • x • t • b • f • { • H • e • l • l • o • <sp> • #1 • } •
@ • c • a • t • c • o • d • e • ` • @ • \= • 0 • <sp> •
\catcode • ` • \@ • = • 1 • 1 • <sp>
where
@, `, 0, 1 and = have category code 12,
{ and } have category code 1 and 2 respectively,
<sp> has category code 10,
- the letters have category code 11.
The category codes are frozen once they have entered TeX's mouth. When the macro \mycommand{Worlds} is expanded, TeX will change the category code for all @ it will absorb from that point on (respecting groups), but this can't change in any way what has already been tokenized, for instance the sequence of tokens
@ • * t • e • x • t • b • f
that have already been stored.
Something will be printed, precisely
@textbfHello World @catcode‘@0
(the 0 will have a bar over it) and TeX won't have any character with category code 0 meaning it won't recognize commands.
I'll do an example in Plain TeX, which is easier to print, but essentially equivalent. I'll only add \csname bye\endcsname to end the game:
\def\mycommand#1{
\catcode`\@=0
\catcode`\\=11
@textbf{Hello #1}
@catcode`@\=0
\catcode`\@=11
\csname bye\endcsname
}
\mycommand{World}

Remember that when TeX executes \def, it completely disables macro expansion and command execution of the tokens it absorbs for the macro name, the parameter text and the replacement text. It will only expand the tokens in the replacement text but again not execute them when it's doing an \edef.
\catcodecommands outside the\mycommanddefinition. egreg's answer gave me the explanation for what was tripping me up. – Joseph R. Jan 05 '14 at 00:48