In the United States, at the time you are placing the order, you would say "This is to go," or "I want this to go," or "Your number three dinner, and a coke and an extra side of mashed potatoes, to go."
Restaurants that do a take-out business will almost always ask you before you ask them! Common phrasing is "Is this to eat here, or to go?" Or (pretending to be elegant!) "are you dining in, or this to go?" Or "are you dining in, or taking out?" Echo their words when you answer: "to go" if they said "to go," "to take out" if they said "to take out." Don't bother to construct a complete sentence, just say "To go," or "To take out."
If you are eating on a plate at the table, and you can't finish everything, you say "I'd like to take this with me" or "can you wrap this up to go?" The form of the words doesn't matter at all. And, in the US nowadays, the waitstaff will usually ask you before you ask them!
(Out-of-date historical and cultural note: People nowadays hate to waste food, and it will be thrown out if you don't finish it. Fifty years ago, it was thought to be inappropriate to take leftover food with you, and people would use the polite fiction that they were taking it for their dog! And it was quite common for restaurants to say "can we put that in a doggy bag for you?" Originally people would do this with steak or a piece of meat, but it got to be quite ridiculous in the 1960s because people would ask for "doggy bags" for vegetables and desserts!)