As an example, can the US Congress declare that jaywalking is a federal offense? Or would the jaywalker have to cross a state border in order for the crime to become prosecutable by federal authorities?
Legally, no, Congress can't pass laws just because it feels like it. Article I, Section 8 of the Constitution contains a set of powers Congress has.* Other sections give Congress additional powers. Elsewhere in Article I, Congressional consent is required for states to make interstate agreements, keep military forces in peacetime, and impose tariffs. It's implied that Congress may suspend habeas corpus in the event of rebellion or invasion. Article III provides another authority for Congress to establish courts, allows Congress to regulate the appellate jurisdiction of the Supreme Court, and allows Congress to fix a penalty for treason. Article IV lets Congress make rules about interstate recognition of judgments and official records and gives Congress the power to make rules governing property owned by the United States.
Many amendments give Congress even more powers (generally by saying something like "Congress has the authority to enforce this amendment"). The 13th Amendment says Congress can ban slavery. The 14th Amendment says Congress can enforce its provisions (which require states to give due process and equal protection). The 15th, 19th, 24th, and 26th Amendments expanded voting rights and gave Congress the power to enforce them. Etc.
So Congress has a lot of powers, but the key is that their powers are enumerated. For any federal law, you can ask what authority Congress used to enact that law.
However, there's a world of difference between what powers Congress technically has and what powers they practically have. The final enumerated power is to pass all laws which are necessary and proper for carrying out some other power. Sometimes, this is a fairly direct extension of the applicable power. Nothing in the Constitution explicitly says Congress can pass a law against harboring deserters, but it's a law which is important for ensuring that the US can field an army.
Sometimes, though, the link is very tenuous. If you read federal laws, they often contain the phrase "in or affecting interstate or foreign commerce." Just about everything can be tied to commerce in some way or another, and interstate commerce is something Congress has the power to regulate. Regulating interstate commerce is the justification for DOT regulation of long-haul trucking, which is clearly commercial. It's also the justification for antidiscrimination laws, because discrimination had a serious chilling effect on travel within the country (hard to visit a city if there's no hotel that will accept you). It's also the justification for banning the growth and consumption of marijuana for personal use, under the theory that even though it's illegal to trade it across state lines, there is in fact an (illegal) interstate market and growing your own might in some way affect that market.
The courts very rarely strike down laws on the basis that they fall outside Congress's enumerated powers. They did in a case in the 1990s about the Federal Gun-Free School Zones Act, but Congress then amended it to say it only applied to guns if the gun or any of its components at some point traveled in interstate or foreign commerce (which is almost every gun). More recently, the Supreme Court upheld a law against personal growth of marijuana for personal consumption.
The Congress shall have power to lay and collect taxes, duties, imposts and excises, to pay the debts and provide for the common defense and general welfare of the United States; but all duties, imposts and excises shall be uniform throughout the United States;
To borrow money on the credit of the United States;
To regulate commerce with foreign nations, and among the several states, and with the Indian tribes;
To establish a uniform rule of naturalization, and uniform laws on the subject of bankruptcies throughout the United States;
To coin money, regulate the value thereof, and of foreign coin, and fix the standard of weights and measures;
To provide for the punishment of counterfeiting the securities and current coin of the United States;
To establish post offices and post roads;
To promote the progress of science and useful arts, by securing for limited times to authors and inventors the exclusive right to their respective writings and discoveries;
To constitute tribunals inferior to the Supreme Court;
To define and punish piracies and felonies committed on the high seas, and offenses against the law of nations;
To declare war, grant letters of marque and reprisal, and make rules concerning captures on land and water;
To raise and support armies, but no appropriation of money to that use shall be for a longer term than two years;
To provide and maintain a navy;
To make rules for the government and regulation of the land and naval forces;
To provide for calling forth the militia to execute the laws of the union, suppress insurrections and repel invasions;
To provide for organizing, arming, and disciplining, the militia, and for governing such part of them as may be employed in the service of the United States, reserving to the states respectively, the appointment of the officers, and the authority of training the militia according to the discipline prescribed by Congress;
To exercise exclusive legislation in all cases whatsoever, over such District (not exceeding ten miles square) as may, by cession of particular states, and the acceptance of Congress, become the seat of the government of the United States, and to exercise like authority over all places purchased by the consent of the legislature of the state in which the same shall be, for the erection of forts, magazines, arsenals, dockyards, and other needful buildings;--And
To make all laws which shall be necessary and proper for carrying into execution the foregoing powers, and all other powers vested by this Constitution in the government of the United States, or in any department or officer thereof.
The powers of Congress are enumerated in Article I Section 8 of the US Constitution, and under the Tenth Amendment, it has no other powers than those. So if Congress were to pass a federal law against jaywalking, someone convicted of violating it could claim that the law was unconstitutional, and the government would have to convince a court that the law was actually part of those enumerated powers.
It's hard to guess how they might do that in general, because none of the enumerated powers on its face seems to include the power to regulate pedestrian traffic. But some of them have been interpreted very broadly by courts, particularly the power to "regulate commerce [...] among the several states" which is, for instance, how the federal government derives the power to prohibit controlled substances. I suppose the federal government could argue that jaywalking affects interstate commerce, e.g. because pedestrians who jaywalk have a higher chance of being hit by cars, thus needing medical treatment which uses supplies sold across state lines. But I'm just speculating.
The federal government can make laws regulating jaywalking on federal property. For instance, 36 CFR 4.12 makes it illegal to disobey a traffic control device, which would include a pedestrian crossing against a "DONT WALK" sign. 36 CFR 1.3 says a violation is a federal crime punishable by fine or imprisonment.
The federal government can also attempt to coerce states into making laws about things that it can't regulate itself. For instance, the nationwide drinking age of 21 was accomplished state-by-state, when Congress threatened to reduce highway funding for any state that didn't change its laws accordingly.
No. The federal government does not have general police powers and may only write laws in furtherance of its constitutionally delegated authority.
Any law has to be supported by one of Congress's enumerated powers, but that is a lot broader than it sounds. Congress has the authority to regulate interstate commerce, and current interpretations of that power expand to virtually anything. Under Gonzales v. Raich, 545 U.S. 1, 16 (2005):
Congress can regulate the channels of interstate commerce [highways, rivers, railroads, the Internet]. ... Congress has authority to regulate and protect the instrumentalities [trucks, trains, railroad cars] of interstate commerce, and persons or things in interstate commerce. ... Congress has the power to regulate activities that substantially affect interstate commerce.
There aren't very many things that don't satisfy this test, but the court has found a few exceptions in recent years. For instance, the Court held in NFIB v. Sebelius, 567 U.S. 519, 558 (2012) that Congress can't use that authority to compel citizens to engage in commerce, and that logic would presumably prohibit Congress from making a criminal law against not having health insurance.
Other decisions have rejected attempts to legislate against gender-motivated violence (U.S. v. Morrison, 529 U.S. 598 (2000)) and possessing a gun in a school zone. (U.S. v. Lopez, 514 U.S. 549 (1995)).
These cases are outliers, though; the test for Commerce Clause authority is a very forgiving one, and most challenges fail.
Note, though, that this is a limit on Commerce Clause authority, and that even when a law fails the that test, there may be some other enumerated power to save a law. That was what happened in NFIB, where the individual mandate failed the Commerce Clause but was a valid use of the even broader authority under the Taxing Clause.
The Taxing Clause probably couldn't be used to directly criminalize anything, but you could probably daisy-chain enumerated powers to get there. It's theoretically possible, for instance, that Congress could use the Taxing Clause to impose an impossibly high tax on failing to carry health insurance, and then use the Necessary and Proper Clause to establish criminal penalties on anyone who fails to pay the tax.