How do you decide how much money to request? Must you have a detailed list of costs? How much money can be taken by the PI, for instance, for summer pay? I really don't understand how the numbers are reached; they seem totally arbitrary to me.
For senior personnel (like the principal investigators) the NSF limit salary to 2 months salary for each person per year, which is held across all NSF-funded grants (so if you are listed on 100 NSF grants you still can only get 2 months per year for yourself in total).
As to the budget questions - yes, you'll need a budget, plenty of supporting detail and reasoning, and yes there are lots of rules about everything from computer equipment to salary for clerical workers. Most common questions can be answered by reviewing the NSF Proposal & Award Policies & Procedures Guide. There is no single rule of thumb on how much to ask for, as the range of awards varies quite widely (and for the NSF is usually stated in Dear Colleague letters or public grant invitations on specific topics), but in general if you don't have a really good idea of how much things might cost to go into the budget for what to ask for, the panel will probably quickly notice you haven't thought things out in enough detail and reject it easily in an early round. You can be reasonably assured that someone - and probably many people - will look at each line item in a submitted budget, so they will need to be sensible, clearly defined, and obviously necessary or highly desirable for ensuring the success of the project. If the budget given does indeed seem arbitrary to someone who has looked at hundreds of grant requests in the last month (or week), that will not bode well for the likelihood of success.
If you are affiliated with an institution that applies for NSF funding in general, there is probably a dedicated staff member (or a whole department) dedicated to supporting grant requests, so you should also definitely reach out to them to get information on what sort of support is available - which is much easier than trying to figure out everything on your own. They may have templates, workshops, guides, internal reviews, etc. - or at least, some institutions have all that. Check to see before doing it all the hard way.
As a research administrator who has worked in CS, Electrical Engineering, and Chemistry and submitted applications to more than 15 federal sponsors in the last eight years, I recommend all PIs do four things when unfamiliar with a funding announcement:
1) Review the program announcement, BAA, RFP, or solicitation for any explicit limitations. Pay attention at the beginning to see if there are additional rules you must learn and adhere to-- NSF, NIH, DOD, and NASA all have additional rule books that are referenced in the solicitation.
2) Go to the data repository for the sponsor (if federal) to see what kinds of projects are funded at what level. (NSF is here: https://nsf.gov/awardsearch/advancedSearch.jsp) Some programs will be easy to search for with the advanced search. E.g., "CAREER" requires the program name in the title. Make sure you limit by directorate if applicable, as they do not have the same funding policies.
3) Contact the program officer and ask what the expected funding levels are. NSF is famous in some directorates for not posting a max, and yet actually having a maximum. I have heard faculty joke that NSF means "Not Sufficiently Funded." It's not a joke.
4) Contact your assigned research administrator and ask for a budget. You need to know if you are being realistic in your demands for your scope of work, but also for the specific program you are applying to. Institution rules may limit your effort to an amount (perhaps 3 months, maybe more) or time frame (summer vs. calendar). You may have to contend with a large IDC rate, and the choice of sponsor will change the role IDC plays in your budget--NSF awards inclusive of IDC; NIH awards IDC on top of direct costs. Engaging your research admin will elucidate these issues for you. Being inquisitive and letting them know you want details will be very helpful; many admins truncate advice to PIs, because they assume they don't want to know too much and are very busy. Budgeting is highly complex and should not be done by a PI (although that can happen at smaller schools). Consider also taking time to look at your sponsored programs website for more help on policies, including effort policies, rate agreements (fringe and indirect costs), computing policy, and policies on user fees or other facility costs if applicable. This will facilitate your conversation with your research admin.
Final note: take the budget justification seriously. I saw a senior PI this week get their entire 15k for foreign travel (conferences) cut by DOD due to lack of justification. OTOH, I recently got my more junior PI approved for double that amount on a DARPA I submitted in June (also for foreign conferences). Convince them you know why you are asking for money and that you actually understand what things cost, and you are less likely to see budget cuts, particularly in the case of NSF and DOD.