There should probably be a break-in procedure from the factory. There is no set RPM since engines are all so different and have different power-bands.
Once it's broken in, you can experiment with what works for you. The biggest thing you need to know is when to down-shift. You can mess up an upshift and just bog the engine. If you drop down too many cogs, you can dump yourself unless your bike has a slipper clutch.
It depends upon the situation. If you're in no big hurry 3-4k is adequate. If a 80,000 lb semi is bearing down on you, then you better red line if before you get squashed. If you're sneaking away from a jealous man's house after he came home early and you crawled out the bedroom window, then you better short shift it and not exceed 2k.
As far as a new bike goes, the first 500 miles or so, try to not exceed around 60% of the redline rpm. For example, if it redlines at 10,000 rpm, then try to not exceed 6,000, especially for extended periods of time. As you get more miles on it, you can gradually up the maximum rpm until around 1,000 miles. After that you can knock yourself out.