Best way to determine if primary fermentation is done would be to take a gravity reading over a couple of days to be sure it doesn't change.
Yes, taking multiple gravity readings until it levels out will tell you when primary fermentation is done. However, it will
not let you know when the beer is actually done. Bottling at the precise moment gravity readings level out is not a wise choice for the best quality beer. You will likely have a better beer if you let it sit for a few weeks before bottling. Test this if you wish. The dense layer of C02 atop the beer will protect it so there is no real worry of oxygenation.
As far as secondary fermentation you can't go wrong with at least 2 - 4 weeks. Some styles don't really require a secondary but you could do it anyways to improve clarity and condition the beer more prior to bottling or kegging.
Most styles do not require being racked to a secondary vessel; and even less require secondary fermentation. As a beginner, you will very likely do more harm than good by racking to secondary. Besides, that time frame is typically 1-2 weeks for ales, not 2-4.
The yeast will take maybe a couple days at the end of fermentation to convert and absorb those compounds, but you don't need to give it weeks because once the beer drops clear, the yeast are pretty much done. The only rounding out of flavors at that point is best done at colder temps so that any other particulates will settle out.
The sedimentation and clean-up phase is the final step of the fermentation process where the yeast cells have eaten the majority of the fermentable sugars in the wort, now the yeast cells start consuming let over flavor precursors that will produce off flavors in your beer. It's during this phase that the yeast cells prepare to go dormant by storing up energy reserves for their deep sleep and then dropping out of suspension and settling at the bottom of the fermentor. They are not yet dormant. They are still cleaning up the beer and consuming precursors. The time this takes to fully complete is up for debate. No hard proof on either side.
Last year, I brewed one of my house IIPAs and the bottling date fell in line with my vacation in another country. I was forced to bottle early; primary fermentation had just completed and I had just enough time to dryhop. On the last day of the dryhop, I bottled. Upon my return, I tasted the beer and it was not of the same quality that I was used to. The extra primary time really made a difference for me. Maybe someone else wouldn't have noticed, but I'm pretty familiar with the intended character of a house IIPA that I've brewed dozens of times.
There are tons of brewers making incredible beer from grain to glass in 2 weeks.
The supposed best beer in the world right now takes 28 days grain to can... Heady Topper.